I have a solution model form with some fields showing only if a checkbox is selected. Selecting the checkbox fires a solution model method. The dataprovider of the field is a variable containing values that I would like to be able to modify in certain circumstances. The problem is that the field never shows the expected value, but it is empty. I am sure, however, that the associated dataprovider variable contains the correct value.
var fldNo = (a number)
var chkMod = (a checkbox field)
for(var i = 0; i < fldNo; i++)
{
solutionModel.newGlobalVariable('globals','gb_vr_modVal' + i,JSVariable.TEXT);
scopes.globals['gb_vr_modVal' + i] = 'new' + i;
var modValFld = frmCsv.newField(scopes.globals['gb_vr_modVal' + i],JSField.TEXT_FIELD,chkMod.x + 20 + 10,chkMod.y,280,20);
modValFld.name = 'modValFld' + i;
modValFld.visible = false;
modValFld.transparent = false;
}
var chkMeth = "function chkModMeth(oldValue,newValue,event) { if(newValue == 1) { forms['frmCsv']elements['modValFld' + event.getElementName().substring(6)].visible = true; } }
chkMod.onDataChange = chkMeth;
I tried to change the value of the field dataprovider after making it visible, but same result. And if I do a recreateUI() the field disappear.