--
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/groups/opt_out.
If I understand what you are trying to do correctly, I do not understand why you are using a regex and feedback at all. I have many similar instances as you have but handle them directly with a call to the JS function.
On the action for the button in the list I directly call a JS function presenting enough information in the arguments I pass on the call to allow the function to operate. One of the things you would pass is germane to which button if there are more than one button in a list item relating to different process (perhaps 2 buttons, one for zone and one for device), the list index at which that button is located. For example the zone number might be related to the list index. i.e the button at list index 0 is for zone 1, the button at list index 1 is for zone 2, and in general the button for list index n is for zone n+1,
ergo on the JS action for a button you might have the call to the zoneLogic function as
zonelogic(listIndex);
the zoneLogic function might then look like:
ZoneLogic = function(zoneNum) { // zoneNum is the list
index which is 1 less than the zone number and is an integer
CF.log("The zone is: " + (zoneNum+1))
switch (zoneNum)
{ case 0: // the list index is 0 so the zone number is 1
CF.setJoins([
{
join:"s10", value:"house80x80.png" },
{
join:"s11", value:"Main" },
{ join:"d1",
value:1 }, // show main activities
{ join:"d2",
value:0 }, // hide FR activities
{ join:"d3",
value:0 }, // hide kitchen activities
{ join:"d4",
value:0 }, // hide dining room activities
{ join:"d5",
value:0 }, // hide deck activities
{ join:"d6",
value:0 } // hide zones
]);
return;
case 1: // the list index is 1 so the zone number is 2
whatever code is needed for zone 2
return;
.
.
.
case 6: // the list index is 6 so the zone number is 7
whatever code is needed for zone 7
return;
};
};
if (zoneNum[1] == 1) {
CF.setJoins([
{
join:"s10", value:"house80x80.png" },
{
join:"s11", value:"Main" },
{ join:"d1",
value:1 }, // show main activities
{ join:"d2",
value:0 }, // hide FR activities
{ join:"d3",
value:0 }, // hide kitchen activities
{ join:"d4",
value:0 }, // hide dining room activities
{ join:"d5",
value:0 }, // hide deck activities
{ join:"d6",
value:0 } // hide zones
]);
}
snip...
I suspect this might be more efficient than doing the watch, and the feedback
--