Hello dear Community,
in my report I have a combo box where I can select a zoom factor for the graphics. It works well in this direction.
Now I would like to set the combo box to one of the options depending on another input. And that doesn't work.
According to the help in ARIS, the following function should do exactly what I want:
Report class Dialog void setDlgSelection (String sDlgItem, int nSelectedIndex) - Sets selection for lists, combo boxes and tables.
Alternatively I found the following function:
Report class SingleSelectElement boolean setSelection (int nSelectedIndex) - sets the selected index (single selection)
Unfortunately, however, both functions do not deliver the desired result. Either the report runs without errors, but without the desired result, or I get an error message.
The command lines between the two "///" are the variants I tried and the comment behind them is the result. However, only one variant was activated at a time. The others were commented out.
The error messages are listed under the source code.
Can anyone tell me why this doesn't work for me and what mistake I made? How can I set the combo box correctly? I can't imagine that shouldn't work with combo boxes. This works for all other input objects.
Many thanks to all of you who take care of this and support me.
---
And here the addressed source code:
var aGrSize = new Array(); // Table of zoom factors function DIA_configSubDialog() { ... aGrSize = ["automatisch", "individuell", "100%", " 70%", " 30%"]; this.getPages = function() { ... oOptions.CheckBox(30, 90, 280, 15, "Change size", "GrSize"); oOptions.ComboBox(100, 110, 110, 20*aGrSize.length, aGrSize, "GrSelW"); ... return [oOptions]; } this.OptCod_changed = function(sNewSel) { var aPages = new Array(); aPages[0] = this.dialog.getPage(0); ... aPages[0].getDialogElement("GrSize").setChecked(lPrGrSiz); ... aPages[0].getDialogElement("GrSelW").setEnabled(true); // That works /// aPages[0].getDialogElement("GrSelW").setSelection(nSelection); // Gives no error, but no reaction at the dialog window this.dialog.getPage(0).getDialogElement("GrSelW").setSelection(nSelection); // Gives also no error, but does not work aPages[0].setDlgSelection("GrSelW", nSelection); // Gives an error (1) this.dialog.setDlgSelection("GrSelW", nSelection); // Gives an error (2) Dialogs.setDlgSelection("GrSelW", nSelection); // Gives an error (3) oOptions.setDlgSelection("GrSelW", nSelection); // Gives an error (4) /// ... } }
(1) Dialog function call failed:org.mozilla.javascript.EcmaError: TypeError: Cannot find function setDlgSelection in object DialogPag.
(2) Dialog function call failed:org.mozilla.javascript.EcmaError: TypeError: Cannot find function setDlgSelection in object UserDialo.
(3) Dialog function call failed:org.mozilla.javascript.EcmaError: TypeError: Cannot find function setDlgSelection in object Dialogs.
(4) Dialog function call failed:org.mozilla.javascript.EcmaError: TypeError: Cannot find function setDlgSelection in object com.aris.modeling.server.bl.logic.webreprot.dialog.AServerDialogBuilde.