For a simple list of strings, here is a working example that copies the previous choice values into the new constraint before updating.
<abs contexttype="opengear">
<meta>
<params>
<param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="Test" oid="Test" type="STRING" value="A" widget="list">
<constraint>A</constraint>
<constraint>B</constraint>
<constraint>C</constraint>
</param>
<param access="1" maxlength="0" name="Entry Field" oid="Entry_Field" type="STRING" value="Test" widget="text"/>
</params>
</meta>
<param expand="true" height="248" left="36" oid="Test" scroll="vertical" top="139" width="289"/>
<button buttontype="push" height="43" left="227" name="Add" top="92" width="92">
<task tasktype="ogscript">var c = params.getConstraint('Test');
var choices = c.getChoices();
var newChoices = [];
for (var i = 0; i < choices.length; i++)
{
newChoices.push(choices[i]);
}
newChoices.push(params.getValue('Entry_Field', 0));
params.replaceConstraint('Test', params.createStringChoiceConstraint(newChoices));</task>
</button>
<param expand="true" height="38" left="35" oid="Entry_Field" top="94" width="185"/>
</abs>
#DashBoard