Hey James,
Thanks for the response. Hmmm... the problem may be deeper than that then. It looks like my code is correct but for some reason the value won't update.
var i = 0;
var tot = params.getValue('numListeners', 0);
var x = 16;
var str = '';
var posY = 0;
while (i < tot) {
var listenerIP = 'listener' + i;
var newIP = {
"oid" : listenerIP,
"name": listenerIP,
"readonly": false,
"type": "STRING",
"widget": "TEXT ENTRY",
"value": "DECK #" + i + " IP ADDR"
};
var newParam = params.createParam(newIP);
var listenerIPConnection = listenerIP + 'Conn';
posY = 20 + 80*i;
str = str + '<table height="80" left="20" top="' + posY + '" width="800" insets="3,2,2,2"><tr> \
<param colspan ="1" fill="both" oid=\'' + listenerIP + '\' rowspan="1" weightx="1.0" weighty="1.0">\
<task>\
ogscript.debug(\'new IP: \' + this.getValue());\
</task>\
</param>\
<listener autostart="false" blockingpause="true" buttontype="toggle" connecthost="%value[\'' + listenerIP + '\'][0]%" connectport="3811" delimitertype="newline" fill="both" weightx="1.0" weighty="1.0" rowspan="1" colspan="1" id="' + listenerIPConnection + '" name="CONNECT" style="style:toggleButton;"> \
<task>\
ogscript.debug("TASKINGTASKASK");\
</task>\
<task tasktype="ogscript">\
if (event.isConnectEvent()){ \
ogscript.debug("CONNECTING TO THINGY");\
ogscript.putObject("' + listenerIPConnection + '", this); \
ogscript.debug("CONNECTING TO:' + listenerIPConnection + '");\
sendNextMessage("' + listenerIPConnection + '", ["CRAT0007204Vtr1\\n"]); \
} \
else if (event.isMessageEvent()) \
{ \
ogscript.debug("[RECEIVED] " + event.getBytesAsString()); \
} \
else if (event.isDisconnectEvent()) \
{ \
ogscript.debug("-- CONNECTION CLOSED! --"); \
} \
else \
{ \
ogscript.putObject("' + listenerIPConnection + '", null); \
}\
</task> \
</listener> \
<button colspan="1" fill="both" id= "start' + i + '" name="START" rowspan="1" weightx="1.0" weighty="1.0"> \
<task tasktype="ogscript">ogscript.debug("Button2");sendNextMessage("' + listenerIPConnection + '", ["CMDS00042002\\n"]);</task></button> \
<button colspan="1" fill="both" id= "stop' + i + '" rowspan="1" weightx="1.0" name="STOP" weighty="1.0"> \
<task tasktype="ogscript">ogscript.debug("Button3");sendNextMessage("' + listenerIPConnection + '", ["CMDS00042000\\n"]);</task></button> \
</tr></table>';
i++;
}
ogscript.setXml('dynamicContent', str);
When I set connecthost to a static value everything works minus changing of the IP with the parameter text box, but when I try using the %value method it doesn't seem to do anything or trigger any of the tasks tied to the listener. Maybe there's a character escaping that shouldn't? It's pretty rough to debug the code since I'm setting the XML through the button task when I try to edit and look and what code it's creating it goes away.
#DashBoard