GlideDialogWindow help - base form reloading when returning from a pop-up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2010 09:21 AM
I've created an Action to create 1 or many child records on through the use of a pop-up. I lifted code from Project Management to do this - UI Action 'Project Task Creator'.
The UI Action will pop a simple dialog prompting for the number of child records to be created. Enter a number, click 'OK' and the records are created.
The child creation is working quite nicely. What I'm having an issue with is when control is returned from the dialog, the base form reloads and any field modifications that may have been made before clicking the UI Action are lost. I'm looking for a creative solution around this. I don't want the form to reload, but I do want the related list of child records to refresh and show the new children.
I'm no Jellyscriptor. I'm not even sure if that's where the problem/solution lay. Is there something specifically in the code that is triggering the reload?
Here is my Ui Action:
onClick: popIAFActionItem();
function popIAFActionItem() {
var gDialog = new GlideDialogWindow('apply_iaf_action_creator');
var sysid = g_form.getUniqueValue();
var tableName = g_form.getTableName();
gDialog.setPreference('sysparm_sysID', sysid + "");
gDialog.setPreference('sysparm_table', tableName + "");
gDialog.setTitle('Action Item Creator');
gDialog.render();
I've attached my Jellyscript from the UI Page 'apply_iaf_action_creator'. I did not include the code from the UI Page that creates the children since that's working just fine.
Thanks in advance for looking at this.
Sandy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2010 06:21 AM
Does your UI Page have any buttons on it? If so that will cause the page to be submitted, which based on the fact that the page creates child items I would say that is what is probably doing it. What you are probably going to have to do is to is have a client script do all of the work of creating the items via web services and then figure out what function to call to get the related list to load.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2012 10:52 AM
If you don't want the base form to reload, you can close your dialog box gracefully with the following code in your UI page Client Script (usually this would be in a function that is called when a "cancel" button is clicked)
GlideDialogWindow.get().destroy()
and it shouldn't submit your form. However, you won't be able to see any changes to your base form either (including new records in a related list).
If your concern is only that field changes are being lost, you can submit the form to save the field changes and then reload the form as follows (usually this would be in a function that is called what a "save" or "submit" button is clicked):
gsftSubmit(gel('sysverb_update_and_stay'));
GlideDialogWindow.get().destroy();
return true;
This way your related lists would get updated as well.