I have a modal dialog that I commit by calling window.frameElement.commitPopup(), and this is great because it refreshes the parent window.

However I would also like to display a notification on the parent window afterwards using SP.UI.Notify.addNotification() (to show a success message), but because the parent window refreshes, there is no time to show the notification.

I can think of some ways using cookies or client storage, but I wondered if there was a different native SharePoint way to go about this?


3 Answers 3


Try this code:

function showDialog(){
    url: urlToOpen,
    title: "title",
    allowMaximize: true,
    showClose: true,
    width: 800,
    height: 600,
    dialogReturnValueCallback: silentCallback
function silentCallback(dialogResult, returnValue) {
    switch (dialogResult) {
        case SP.UI.DialogResult.cancel:

you can use SP.UI.ModalDialog and create a custom function when dialog is closed as it is shown here: Using SP.UI.ModalDialog in SharePoint 2010 | Jon Dack http://www.jondack.com/index.php/2011/01/24/using-sp-ui-modaldialog-in-sharepoint-2010/

hope it helps

  • Yes, but that will only work if you do not refresh the parent page. Once you refresh the parent page, your notification is gone, and no way to load it on the newly refreshed parent page.
    – Adam Toth
    Jan 14, 2013 at 22:10

If you absolutely want to refresh the page and notify the user, you could store the notification as a cookie or in the localStorage and then, when the page is refreshed, get this notification text and show it to your user. I would do it so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.