Hello,
I work on a script which display a dialog made of 2 pages.
In the first page, the user will select a value from a list.
Depending on this value, the script store in a variable another value. I wish to display this value in the second page, but this doesn't work. Only "undefined" is displayed.
var loc = Context.getSelectedLanguage();
var user = ArisData.getActiveUser();
var db = ArisData.getActiveDatabase();
var filter = ArisData.ActiveFilter(); // Filtre actif
var filter_guid = filter.GUID(); // GUID du filtre actif
var result = Dialogs.showDialog(new myDialog(), Constants.DIALOG_TYPE_WIZARD, "Création/Suppression de relations");
////////////////////////////////////////////// Fonctions //////////////////////////////////////
function myDialog()
{
// all member functions except for getPages can access the property "dialog" of the dialog class. Type is "UserDialog" (see help).
// examples:
// - Get the page with the specified index (e.g. 0): this.dialog.getPage(0)
// - Define the list of visible wizard pages (e.g. 0,1): this.dialog.setActiveWizardPages([0,1])
// returns DialogTemplate[]
// non-optional
var createRelationObjectName;
var symbList = new Array();
symbList[0] = ["Function","Cluster"];
symbList[1] = ["obj1","obj2"];//[["obj1","obj2","obj3"],["obj4","obj5","obj6"]];
this.getPages = function()
{
/********* 1er écran *********/
var iDialogTemplate1 = Dialogs.createNewDialogTemplate(600, 200, "Creation of a relation");
iDialogTemplate1.ComboBox(10, 120, 200, 40, symbList[0], "SYMB_LIST_1");
//actions
iDialogTemplate1.CancelButton();
/********* 2nd écran *********/
var iDialogTemplate2 = Dialogs.createNewDialogTemplate(400, 200, "Validation");
iDialogTemplate2.Text(10, 30, 1600, 40, "selected object : "+createRelationObjectName, "TEXT_2_2");
//actions
iDialogTemplate2.CancelButton();
iDialogTemplate2.PushButton(10, 170, 200, 28, "add a new relation", "BUTTON_NEW");
return [iDialogTemplate1, iDialogTemplate2];
}
// initialize dialog pages (are already created and pre-initialized with static data from XML or template)
// parameter: Array of DialogPage
// see Help: DialogPage
// user can set control values
// optional
this.init = function(aPages)
{
}
// returns true if the page is in a valid state. In this case "Ok", "Finish", or "Next" is enabled.
// called each time a dialog value is changed by the user (button pressed, list selection, text field value, table entry, radio button,...)
// pageNumber: the current page number, 0-based
this.isInValidState = function(pageNumber)
{
return true;
}
// called when the page is displayed
// pageNumber: the current page number, 0-based
// optional
this.onActivatePage = function(pageNumber)
{
}
// returns true if the "Finish" or "Ok" button should be visible on this page.
// pageNumber: the current page number, 0-based
// optional. if not present: always true
this.canFinish = function(pageNumber)
{
return true;
}
// returns true if the user can switch to another page.
// pageNumber: the current page number, 0-based
// optional. if not present: always true
this.canChangePage = function(pageNumber)
{
return true;
}
// returns true if the user can switch to next page.
// called when the "Next" button is pressed and thus not suitable for activation/deactivation of this button
// can prevent the display of the next page
// pageNumber: the current page number, 0-based
// optional. if not present: always true
this.canGotoNextPage = function(pageNumber)
{
return true;
}
// returns true if the user can switch to previous page.
// called when the "Back" button is pressed and thus not suitable for activation/deactivation of this button
// can prevent the display of the previous page
// pageNumber: the current page number, 0-based
// optional. if not present: always true
this.canGotoPreviousPage = 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
// pageNumber: the current page number
// bOK: true=Ok/finish, false=cancel pressed
// optional
this.onClose = function(pageNumber, bOk)
{
}
// the result of this function is returned as result of Dialogs.showDialog(). Can be any object.
// optional
this.getResult = function()
{
return [relationsToCreate,relationsToDelete];
}
this.SYMB_LIST_1_selChanged = function()
{
var symbListRange = this.dialog.getPage(0).getDialogElement("SYMB_LIST_1").getValue();
createRelationObjectName = symbList[1][symbListRange];
}
this.BUTTON_NEW_pressed = function()
{
}
}
Does anybody knows how to manage to show a changeable content in a dialog page ?
Robert Goldenbaum on
Hi Fabienne,
you also have to set the value to the dialog element:
this.dialog.getPage(0).getDialogElement("TEXT_2_2").setText(createRelationObjectName)
BR Robert