Hi TMunro.
There are some tricky bits involved with getting the list of sources and destinations out of the selected IPS. I have encoded a panel that has script in place to handle this and you are welcome to use it as the base of your panel. The heavy lifting is done by the function in the tag called "populateDropdownLists".
Please feel free to contact me for further assistance and we can help move you along in your project.
<abs contexttype="opengear" style="">
<meta>
<api>function populateDropdownLists()
{
var nkGlobal = ogscript.getObject("nk-global");
if (nkGlobal == null)
{
return;
}
var nkObj = nk.getActiveSystem();
var sources = null;
var dests = null;
if (nkObj == null)
{
return;
}
var settingsObj = nkObj.getSettings();
if (settingsObj == null)
{
return;
}
sources = [];
dests = [];
var srcObj = settingsObj.getInputs();
for (var i = 0; i < srcObj.getSize(); i++)
{
var src = srcObj.getValueForIndex(i);
var lbl = srcObj.getLabelForIndex(i);
sources.push({"key":src, "value":lbl});
}
var dstObj = settingsObj.getOutputs();
for (var i = 0; i < srcObj.getSize(); i++)
{
var dst = dstObj.getValueForIndex(i);
var lbl = dstObj.getLabelForIndex(i);
dests.push({"key":dst, "value":lbl});
}
params.replaceConstraint('params.source', params.createIntChoiceConstraint(sources));
params.replaceConstraint('params.current_source', params.createIntChoiceConstraint(sources));
params.replaceConstraint('params.dest', params.createIntChoiceConstraint(dests));
}
</api>
<params>
<param access="1" constrainttype="INT_CHOICE" name="Enabled" oid="params.enable" precision="0" type="INT16_ARRAY" value="1" widget="checkbox">
<constraint key="0">Disabled</constraint>
<constraint key="1">Enabled</constraint>
</param>
<param access="1" maxlength="0" name="Time" oid="params.time" precision="0" type="STRING_ARRAY" value="12:00:00" widget="time-picker">
<value>12:00:00</value>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Source" oid="params.source" precision="0" type="INT16_ARRAY" value="-1" widget="combo">
<constraint key="0">In 1</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Destination" oid="params.dest" precision="0" type="INT16_ARRAY" value="-1" widget="combo">
<constraint key="0">Out 1</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Current Source" oid="params.current_source" precision="0" type="INT16_ARRAY" value="-1" widget="label">
<constraint key="0">In 1</constraint>
</param>
</params>
</meta>
<table bottom="6" left="7" right="8" top="81">
<tr>
<table fill="both" weightx="1.0">
<tr>
<label colspan="1" fill="both" header="true" insets="2,2,2,2" name="Enable" rowspan="1" style="" weightx="1.0" weighty="0.0"/>
<label colspan="1" fill="both" header="true" insets="2,2,2,2" name="Time" rowspan="1" style="" weightx="1.0" weighty="0.0"/>
<label colspan="1" fill="both" header="true" insets="2,2,2,2" name="Source" rowspan="1" style="" weightx="1.0" weighty="0.0"/>
<label colspan="1" fill="both" header="true" insets="2,2,2,2" name="Destination" rowspan="1" style="" weightx="1.0" weighty="0.0"/>
<label colspan="1" fill="both" header="true" insets="2,2,2,2" name="Current Source" rowspan="1" style="" weightx="1.0" weighty="0.0"/>
</tr>
<tr>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.enable" orientation="vertical" rowspan="1" showlabel="false" weightx="1.0" weighty="0.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.time" orientation="vertical" rowspan="1" showlabel="false" weightx="1.0" weighty="0.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.source" orientation="vertical" rowspan="1" showlabel="false" weightx="1.0" weighty="0.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.dest" orientation="vertical" rowspan="1" showlabel="false" weightx="1.0" weighty="0.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.current_source" orientation="vertical" rowspan="1" showlabel="false" weightx="1.0" weighty="0.0"/>
</tr>
</table>
</tr>
<tr>
<blank height="1" weighty="1.0" width="1"/>
</tr>
</table>
<abs contexttype="nk-router" height="63" left="16" right="300" top="12">
<meta>
<ogscript attribute="ActiveConfig" handles="attributechange,onload" scopename="nk-router">ogscript.putObject("nk-global", nk);
populateDropdownLists();</ogscript>
</meta>
<nkfunction bottom="4" function="config" right="4" top="4" width="100"/>
<ipslist bottom="4" left="4" right="105" style="style:navigationButton;" top="4"/>
</abs>
<button buttontype="push" height="58" name="Reset Dropdown" right="10" top="8" width="187">
<task tasktype="ogscript">var newConstraint = params.createIntChoiceConstraint([{"key":-1, "value":"None"}]);
params.replaceConstraint("params.source", newConstraint);
params.replaceConstraint("params.current_source", newConstraint);
params.replaceConstraint("params.dest", newConstraint);</task>
</button>
</abs>#DashBoard