I get an error when I try to use your code to see your panel...
(That is a hell of alot of code btw...)
What you can do is make a function, on change on any of your text boxes run the function.
That function must get the value from all the boxes, push those into an array.
Then you create a second array, and iterate through the first array, add the index and the value into that and update the choice constraint.
Example panel below with only 4 text boxes:
<abs contexttype="opengear" gridsize="20" id="_top" style="">
<meta>
<api immediate="true">function updateDropdown () {
var arr = [''];
arr.push(params.getValue(0x2, 0));
arr.push(params.getValue(0x3, 0));
arr.push(params.getValue(0x4, 0));
arr.push(params.getValue(0x5, 0));
//arr.sort(); <--- Include this one if you want your dropdown sorted alphabetically...
var cArray = [];
for (var i = 0; i < arr.length; i++) {
cArray.push({key:i,value:arr[i]});
}
var choiceConstraints = params.createIntChoiceConstraint(cArray);
params.replaceConstraint(0x6,choiceConstraints);
}
updateDropdown();</api>
<params>
<param access="1" maxlength="0" name="Text 1" oid="0x2" type="STRING" value="Name 1" widget="default"/>
<param access="1" maxlength="0" name="Text 2" oid="0x3" type="STRING" value="Name 2" widget="default"/>
<param access="1" maxlength="0" name="Text 3" oid="0x4" type="STRING" value="Name 3" widget="default"/>
<param access="1" maxlength="0" name="Text 4" oid="0x5" type="STRING" value="Name 4" widget="default"/>
<param access="1" constrainttype="INT_CHOICE" name="Dropdown" oid="0x6" precision="0" type="INT16" value="3" widget="combo">
<constraint key="0"/>
<constraint key="1">Name 1</constraint>
<constraint key="2">Name 2</constraint>
<constraint key="3">Name 3</constraint>
<constraint key="4">Name 4</constraint>
</param>
<param access="1" maxlength="0" name="Selected Text" oid="0x7" type="STRING" value="Name 3" widget="default"/>
</params>
</meta>
<param expand="true" height="40" left="20" oid="0x2" top="20" widget="text" width="220">
<task tasktype="ogscript">updateDropdown();</task>
</param>
<param expand="true" height="40" left="20" oid="0x3" top="80" width="220">
<task tasktype="ogscript">updateDropdown();</task>
</param>
<param expand="true" height="40" left="20" oid="0x4" top="140" width="220">
<task tasktype="ogscript">updateDropdown();</task>
</param>
<param expand="true" height="40" left="20" oid="0x5" top="200" width="220">
<task tasktype="ogscript">updateDropdown();</task>
</param>
<param expand="true" height="40" left="20" oid="0x6" showlabel="false" top="260" width="220">
<task tasktype="ogscript">params.setValue(0x7, 0, params.getValueAsString(0x6, 0));</task>
</param>
<label height="40" left="240" name="Selected text: " style="txt-align:east;" top="260" width="100"/>
<param expand="true" height="40" left="340" oid="0x7" top="260" widget="1" width="280"/>
</abs>
Hope this helps! :D
#DashBoard