I have a form that is being created on the fly through the solutionModel. On this form there is just a combobox and a button:
//create the form
var newForm = solutionModel.newForm('newform',controller.getServerName(),controller.getTableName(),'Style',false,400,400);
//create the combobox
var comboboxFld = newProductForm.newField(globals.variationTypeValue,SM_DISPLAYTYPE.COMBOBOX,180,100,160,200);
comboboxFld.valuelist = solutionModel.getValueList('variation_types');
//create new form method
var newScript = "function testValueBtn() {";
newScript += " application.output(globals.variationTypeValue);";
newScript += " };";
var newMethod = newForm.newFormMethod(newScript);
//create button with new method attached
var newBtn = newForm.newButton('Test',180,380,120,20,newMethod);
In the startup script I’ve declared the global ‘variationTypeValue’ with a standard value of ‘1’.
No matter what I select in the combobox, when pushing the button the application output is always ‘1.0’.
Am I overseeing something or doing anything wrong in the above code?