CF.get Joins ()

89 views
Skip to first unread message

LEONARDO DA COSTA FLORIANO

unread,
Sep 28, 2015, 8:12:05 AM9/28/15
to CommandFusion Software


dear, please give me an example how to properly configure CF.get Joins () in páginas 1,2,3,4 and make the return to home.

Attached to set example

I tried using CF.getJoins ("s100" 1) it did not work

please help me
SubpageLogic.rar

vmailtk5

unread,
Sep 28, 2015, 8:18:11 AM9/28/15
to commandfusion
Try 

CF.getJoin("a100", function(join, value, tokens) {
    // regardless of the join type, the value is always a string
    // if we want a number, we need to use parseInt() or parseFloat()
    var num = parseFloat(value);
    if (num > 10.0) {
        CF.log("a100 is above 10");
    } else {
        CF.log("a100 is below 10");
    }
});
or

// Get three joins at once
CF.getJoins(["s1", "s2", "a3"], function(joins) {
    // set s3 to be s1+s2 strings
    CF.setJoin("s3", joins["s1"].value + joins["s2"].value);

    // Check whether a3 exists in this GUI
    if (joins["a3"].value == null) {
        CF.log("Join a3 doesn't exist in this GUI");
    }
});
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LEONARDO DA COSTA FLORIANO

unread,
Sep 28, 2015, 8:27:17 AM9/28/15
to CommandFusion Software, vmai...@gmail.com


My example is with this code below, but does not work, could you please be more clear as I do?
thanks!


// Get three joins at once
CF.getJoins(["s1", "s2", "a3"], function(joins) {
    // set s3 to be s1+s2 strings
    CF.setJoin("s3", joins["s1"].value + joins["s2"].value);

    // Check whether a3 exists in this GUI
    if (joins["a3"].value == null) {
        CF.log("Join a3 doesn't exist in this GUI");
    }
});


Jarrod Bell

unread,
Sep 28, 2015, 6:48:31 PM9/28/15
to comman...@googlegroups.com
Your example had syntax errors (missing the comma and callback function), be very careful to follow the documentation examples.

I am not sure what you are trying to do, please explain in more detail what you want to do with the join data.

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


LEONARDO DA COSTA FLORIANO

unread,
Sep 28, 2015, 7:22:54 PM9/28/15
to comman...@googlegroups.com
dear, I want to create buttons to show and hide sub pages in my home automation control

using javascript CF.getJoins ("S1", 1) goes like this do not know how to do.


// Get three joins at once
CF.getJoins(["s1", "s2", "a3"], function(joins) {
    // set s3 to be s1+s2 strings
    CF.setJoin("s3", joins["s1"].value + joins["s2"].value);

    // Check whether a3 exists in this GUI
    if (joins["a3"].value == null) {
        CF.log("Join a3 doesn't exist in this GUI");
    }
});


see an example:

in my example I can open the sub pages but when I click the second button it does not close the other


--
You received this message because you are subscribed to a topic in the Google Groups "CommandFusion Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commandfusion/viZB-DTG9VI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commandfusio...@googlegroups.com.
js.jpg
subp_1.jpg
btn_1.jpg

Jarrod Bell

unread,
Sep 28, 2015, 7:29:03 PM9/28/15
to comman...@googlegroups.com
If you want to do interlocking, so only one button/page is enabled at a time, try our interlock script:
https://github.com/CommandFusion/DemoUserInterfaces/tree/master/Interlock




Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


LEONARDO DA COSTA FLORIANO

unread,
Sep 28, 2015, 7:40:22 PM9/28/15
to comman...@googlegroups.com
yes, thanks
but to get my doubt I could do it that way? CF.getJoins ("S1", 1)
using a different code?
btn_1.jpg

Jarrod Bell

unread,
Sep 28, 2015, 7:51:48 PM9/28/15
to comman...@googlegroups.com
If you want to "Set" a join state, its like this:

CF.setJoin("d1", 1);

Make sure to use the correct "d", "s", etc, to match the join type you want to change. So a button uses a digital join, so the join string starts with a "d".
Also make sure to use lower case join string.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Reply all
Reply to author
Forward
0 new messages