UI Page: Cancel Button Not Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2022 09:08 AM - edited ‎11-18-2022 09:09 AM
Hello Community,
I'm having an issue with my cancel button not working on a UI page I've built. When I click on the button, it copies any field values I've inserted into the record. If anyone can please take a look at it and let me know what I've missed, I'd greatly appreciate it. It should be fairly simple ... Here is my code:
HTML Script:
<button class="btn btn-default" onclick="closeWindow()" style="margin-right:10px;">Cancel</button>
Client Script:
function closeWindow(){
GlideDialogWindow.get.destroy();
var urlOnStack = GlideSession.get().getStack().bottom();
response.sendRedirect(urlOnStack);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 11:02 AM
@Nya Valdez bit confused can you please elaborate more ? i think we are almost there with the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 01:54 PM
Yes, to explain a bit more - this UI page is actually used in conjunction to a UI Action that is visible as a list UI action on the Release task table (list view). The goal is to update multiple records using that UI Action ("Validation Sign Off"). The UI page opens to show the two fields that match the actual Release Task form and allows the user to update both fields for all selected records in the list view. If a user chooses to update the work notes field, but not check the checkbox which may already be selected - we don't want the checkbox to be deselected. We wish for nothing to be updated on the forms at all when they click cancel. I hope this helps and I really appreciate your guidance on this so far!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2022 09:45 AM
Hi @Mohith Devatte I am still in need of help to make this work. The cancel button should close the UI page without making any updates to the form itself. So far, if I click cancel then it blanks out the fields that I have not updated rather than leaving them alone. Do you have any ideas around d how I can get this to work correctly? Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 07:55 AM
Hello @mdash
Do you have any suggestions around how I might be able to resolve this issue? Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 11:02 AM
I just wanted to bring up one note as you're probably not seeing an error because the window is being destroyed but GlideSession is a server side method.
You'll want to move that into the Server Script part of the UI Page.
However, using the redirect is going to refresh or take you away from the page. If in your last example you need to keep some info you'll either need to pass that back to the page via url parameters or don't redirect until you truly want to close out the page.