It looks like it does work. However, if you have any hidden boxes with values, it appears those are not kept (at least doing it this way).
An alternative method that will work without the !IBIAMP method would to be to:
-first create a textbox and populate it with the same value as you would if you were using the !IBI variable
-second create the control you are wishing to preselect the value with.
-add an onbeforeload event handler to that control. If the control is a combobox it would look something like this:
function combobox1_onbeforeload(ctrl,arrValuesToLoad) {
var preselection = IbComposer_getCurrentSelection('edit1');
for(var i=0; i<arrValuesToLoad.length; i++) {
if(arrValuesToLoad[i].value==preselection) {
arrValuesToLoad[i].selected=true;
}
else{
arrValuesToLoad[i].selected=false;
}
}
No pre-fex is needed and it works with save selection. The only downside (especially since we cannot modify the code) is that the edit1 control must be created before the combobox1 control so that it has a value before combobox1 does.
WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs