Hi everyone,
In my report I have to give option to the user with dialog box to select a destination folder inside ARIS before further selection of objects and models.
How can I present the user all folders(groups) in database?
Thank you in advance
A little bit complicated, but it works:
in your getPages method you add a button to your dialogTemplate
iDialogTemplate1.PushButton(15, 200, 40, 30, "Test", "PB1");
you then add a button-reaction function to your dialog function like this:
this.PB1_pressed = function(){ this.dialog.setBrowseClientFolders("BCF", "Pick a destination folder", "", false); }
- the method above only opens the "Pick a destination folder" dialog, it doesn't return anything
- this.PB1_pressed goes into the same hierarchy level as the this.getPages function, and has to be called exactly like this (button-item identifier + _pressed)
To catch the returned value, you need another method in your dialog function:
this.BCF_subDialogClosed = function(subResult, bOK){ if(bOK){ Context.setSelectedPath(subResult); } }
- again, same hierarchy level as the this.getPages function
- it again has to be called exactly as described (sub-dialog-identifier + _subDialogClosed)
As long as you create your output object with Context.createOutputObject() this should work - it doesn't matter if you created the output object before or after the dialog execution (at least that's the case for me, with ARIS 10.0.3).
I hope this helps.
EDIT
AH CRAP. Miss-read your question. Here is the correction (to pick a group in the active ARIS-Database):
create the button as described above.
then the button-reaction method should be:
this.PB1_pressed = function(){ var activeDB = ArisData.getActiveDatabase(); result = this.dialog.setBrowseArisItems("BF1", "Pick Group", "Pick a group", activeDB.ServerName(), activeDB.Name(Context.getSelectedLanguage()),Constants.CID_GROUP,[]); }
and the catcher method should be:
this.BF1_subDialogClosed = function(subResult, bOK){ var foundGroup = ArisData.getActiveDatabase().FindOID(subResult); if(foundGroup.KindNum() == Constants.CID_GROUP) { //The foundGroup object is an object of the class Group (report). Feel free to do with it whatever you want } }
Thanks Kay,
I think this is it.
Additional question, in the same dialog box I have to list all the models and objects in the database(preferably to be shown as a tree with parent groups and children) and next to each item(model or object) to be checkbox for the user to select that object or model.
Do you have some suggestion?
Thanks again.