Well there's two things to this one...
1: You are trying to push a value pair with an integer identifier into a string array that only contains one set of data.
So if you want to use a "String Array" you dont need the key/value pair, but just an array of string values.
You must also use the "params.createStringChoiceConstraint" instead.
The below example will change the values of the dropdown to your "apples, oranges, bananas.
<abs contexttype="opengear" gridsize="20" id="_top">
<meta>
<params>
<param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="List" oid="List" precision="0" type="STRING_ARRAY" widget="combo">
<value>String 1</value>
<constraint>String 1</constraint>
<constraint>String 2</constraint>
<constraint>String 3</constraint>
</param>
</params>
</meta>
<param expand="true" height="60" left="80" oid="List" showlabel="false" top="80" widget="combo" width="240"/>
<button buttontype="push" height="80" left="380" name="PUSH" top="80" width="140">
<task tasktype="ogscript">var testArr = ["Apples", "Oranges", "Bananas"];
var choiceConstraint = params.createStringChoiceConstraint(testArr);
params.replaceConstraint("List", choiceConstraint);</task>
</button>
</abs>
It does not update the allready selected dropdown value, but if you click the button, then the dropdown, you'll see the new options.
2: If you want to identify each entry by a number (int) instead, you have to change your parameter into an "Int Array" with "choice constraint".
As you might notice, now you have a value on each entry pluss the string value.
Set it to dropdown default or change the widget once placed.
Then the below code would work (wich is more similar to yours):
<abs contexttype="opengear" gridsize="20" id="_top">
<meta>
<params>
<param access="1" constrainttype="INT_CHOICE" name="List" oid="List" precision="0" type="INT16_ARRAY" value="0" widget="combo">
<constraint key="0">String 1</constraint>
<constraint key="1">String 2</constraint>
<constraint key="2">String 3</constraint>
</param>
</params>
</meta>
<param expand="true" height="60" left="80" oid="List" showlabel="false" top="80" widget="combo" width="240"/>
<button buttontype="push" height="80" left="380" name="PUSH" top="80" width="140">
<task tasktype="ogscript">var testArr = ["Apples", "Oranges", "Bananas"];
var cArray = [];
var x = testArr.length;
for (var i = 0; i < x; i++) {
cArray.push({"key":i,"value":testArr[i]});
}
var choiceConstraint = params.createIntChoiceConstraint(cArray);
params.replaceConstraint("List", choiceConstraint);</task>
</button>
</abs>
Note: This one will actually change the selected value in the dropdown before opening it again.
#DashBoard