Good day,
I am creating a Dialog through ARIS script using Business Architect 7.1.
In the Aris Script help file I see that you can add a Help Button to your dialog, but it requires a HelpID to be passed through to it.
How can I create my own help file and use it with this HelpButton method?
Sorry, this is not possible so far. Only the reports shipped with the standard product can use the help at the moment. In this case the help is contained in the default help files.
Your issue is a known requirement which will be realized in one of tne next releases.
Thanks for the reply, looking forward to the future releases.
Just another thing you can maybe help me with.
I'm now trying a context sensitive help, depending on which control has the focus, I want to change the value of Text control.
I'm using the createNewDialogTemplate method with the sDialogFunc parameter. In the Aris Script help file it gives the following information for the Action parameter:
4: The dialog item DlgItem retains the focus. SuppValue is the item that loses focus (index, 0 based).
But when I run the script, it looks like the code never gets called.
Is Action=4 the right way to check for focus lost and focus gained? What can I be doing wrong If the code is never called?
Instead of using a dialog function I would appreciate using a JavaScript dialog object. This produces better readable code and you can even create multi-page dialogs.
The following example shows a dialog with focus handlers for 2 dialog controls and illustrates the usage of the dialog object:
var test = 0;
var count = 0;
//this function defines the dialog object:
function myDialog()
{
var result;
//returns DialogTemplate[] (see help)
//non-optional
this.getPages = function()
{
var iDialogTemplate1 = Dialogs.createNewDialogTemplate(20, 20, 600, 200, "First page");
iDialogTemplate1.PushButton(10, 5, 20, 20, "<SYMBOL_ARROWUP>");
iDialogTemplate1.PushButton(35, 5, 80, 15, "Press", "BUTTON_1");
iDialogTemplate1.CheckBox(120, 5, 100, 15, "CheckMe", "CHECKBOX_1");
iDialogTemplate1.TextBox(10, 30, 250, 15, "TXT_EDIT_GRAYED");
iDialogTemplate1.TextBox(267, 30, 100, 15, "TXT_EDIT_NORMAL");
iDialogTemplate1.ComboBox(10, 60, 100, 40, ["Value 1", "Value 3", "Value 2", "Value 4"], "COMBO_1");
iDialogTemplate1.DropListBox(355, 60, 100, 40, ["sorted 1", "sorted 3", "sorted 2", "sorted 4"], "COMBO_4", 3); //sortiert + editierbar
iDialogTemplate1.GroupBox(10, 100, 100, 40, "Group Box", "GROUP_1");
iDialogTemplate1.GroupBox(110, 100, 100, 40, "Group Box 2", "GROUP_2");
iDialogTemplate1.Text(15, 120, 80, 16, "a static text", "STATIC_1");
iDialogTemplate1.Text(10, 170, 100, 16, "stat. Text");
iDialogTemplate1.TextBox(120, 170, 100, 16, "TXT_EDIT_1");
var iDialogTemplate2 = Dialogs.createNewDialogTemplate(20, 20, 400, 200, "Second page");
iDialogTemplate2.Text(10, 10, 100, 16, "stat. Text");
iDialogTemplate2.TextBox(10, 40, 100, 16, "TXT_EDIT_2");
iDialogTemplate2.TextBox(10, 80, 150, 16, "TXT_EDIT_3");
return [iDialogTemplate1, iDialogTemplate2];
}
//initialize dialog pages (are already created and pre-initialized with static data from XML or template)
//user can set control values
//optional
this.init = function(aPages)
{
//use this function also to store the page data locally (for example to access it in "onClose")
aPages[0].getDialogElement("TXT_EDIT_GRAYED").setEnabled(false);
//aPages[0].setFocus("TXT_EDIT_1");
aPages[0].getDialogElement("TXT_EDIT_1").setText("Start value 1");
aPages[1].getDialogElement("TXT_EDIT_2").setText("Start value 1");
aPages[1].getDialogElement("TXT_EDIT_3").setText("Start value field 2");
//aPages[1].setFocus("TXT_EDIT_2");
}
// returns true if the page is in a valid state. In this case OK, Finish, or Next is enabled.
// Dialog: see help
//optional. if not present: always true
this.isInValidState = function(pageNumber)
{
count++;
return this.dialog.getDialogElement("CHECKBOX_1").isChecked();
//return true;
}
// returns true if the "Finish" or "Ok" button should be visible on this page.
// Dialog: see help
//optional. if not present: always true
this.canFinish = function(pageNumber)
{
return true;
}
// returns true if the user can switch to another page.
// Dialog: see help
// pageNumber: the current page number
//optional. if not present: always true
this.canChangePage = function(pageNumber)
{
return true;
}
//called after ok/finish has been pressed and the current state data has been applied
//can be used to update your data
// Dialog: see help
// pageNumber: the current page number
// bOK: true=Ok/finish, false=cancel pressed
//optional
this.onClose = function(pageNumber, bOk)
{
if(bOk==true)
result = this.dialog.getDialogElement("TXT_EDIT_2").getText()
else
result = "cancel"
}
//the result of this function is returned as result of Dialogs.showDialog(). Can be any object.
//optional
this.getResult = function()
{
return result;
}
//other methods (all optional): on[ControlID]_pressed, _focusChanged(boolean lost=false, gained=true), _changed for edit and toggle buttons, _selChanged(int[] newSelection)
this.BUTTON_1_focusChanged = function(bFocused)
{
if(bFocused)
this.dialog.getDialogElement("TXT_EDIT_GRAYED").setText("press the button!")
else
this.dialog.getDialogElement("TXT_EDIT_GRAYED").setText("do something else")
}
//other methods (all optional): on[ControlID]_pressed, _focusChanged(boolean lost=false, gained=true), _changed for edit and toggle buttons, _selChanged(int[] newSelection)
this.CHECKBOX_1_focusChanged = function(bFocused)
{
if(bFocused)
this.dialog.getDialogElement("TXT_EDIT_GRAYED").setText("check this to enable the \'Next\' button!")
else
this.dialog.getDialogElement("TXT_EDIT_GRAYED").setText("")
}
//other methods (all optional): on[ControlID]_pressed, _focusChanged(boolean lost=false, gained=true), _changed for edit and toggle buttons, _selChanged(int[] newSelection)
this.BUTTON_1_pressed = function()
{
this.dialog.getDialogElement("TXT_EDIT_2").setEnabled(false)
//this.dialog.getDialogElement("STATIC_1").setText("new value")
this.dialog.getDialogElement("GROUP_1").setVisible(false)
this.dialog.getDialogElement("GROUP_2").setText("new title")
test = 1;
}
}
//shows the dialog using the dialog object "myDialog":
var result = Dialogs.showDialog(new myDialog(), Constants.DIALOG_TYPE_WIZARD, "Multi page dialog sample");
Dialogs.MsgBox(result)
Hi, I tried to build a 1-page dialog from the code by removing the second dialog template and its controls. However, I got the button OK disabled and can only enable it by checking the CheckMe checkbox.
Is it possible to make the OK button always enabled?
Thank you,
Nguyen
Hi
Good dialog sample.
I have a question:
If I have 2 comboboxes and I want to populate these comboboxes dynamically based on selected values. For example Combobox1 is filled the first. based on the selected value of ComboBox1 I want to populate Combobox2 on run time .
I just want to know if this is doable or not.
Please Help
thanks
Hi!
Yes, this is doable. Just create a handler for the first combo box, which sets the values for the second combo box:
this.COMBO1_selChanged = function(selectionIndexes)
{
this.dialog.getDialogElement("COMBO2").setItems(["Value 1", "Value 3", "Value 2", "Value 4"])
}
Hi Mr. Nguyen,
the OK - button is not enabled because of the result of the callback-method "isInValidState". See below. This Method enables you to decide, if the OK (or Next or Finish)-button is enabled. If this method is not present, these buttons are always enabled.
// returns true if the page is in a valid state. In this case OK, Finish, or Next is enabled. // Dialog: see help //optional. if not present: always true this.isInValidState = function(pageNumber) { count++; return this.dialog.getDialogElement("CHECKBOX_1").isChecked(); //return true; }
BR, Torsten
Hi Torsten,
I don't know if it's the good place to post but the subject is about a dialog box.
I'm looking to reuse the scale function which appears in some native reports. This function permitts the user to put a personnalized scale for the graphics générated (and permitts automatically to fit the graphics to the word page ant to splitt graphics on multi pages).
I tryed to reuse you sample example in order to get a first box with one button "format graphics" which permits to shiow a second dilaog box where the user can give the personnalized size.
Unfortunately, i don't success and don't know how to code that.
Do you have an example of this dialog box or a way which would permit me to success??
Thanks in advance
Favel