2
votes

When a user clicks on my button there appears a SharePoint modal dialog. The popup shows the user a confirmation message. This is already working.

Now I want the following: When the users clicks on the YES button, the first popup closes and and a new modal dialog opens.

Is this possible? And how? Or can i resize the dialog dynamicly when he's already open?

here are my methods to open the dialogs:

function OpenPopup() {
    var options = SP.UI.$create_DialogOptions();
    options.url = "popup.aspx";
    options.width = 230;
    options.height = 235;
    options.title = "";
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallbackNew);
    SP.UI.ModalDialog.showModalDialog(options);
}

function OpenSecondPopup() {
    var options = SP.UI.$create_DialogOptions();
    options.url = "popup2.aspx";
    options.width = 630;
    options.height = 235;
    options.title = "";
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallbackNew);
    SP.UI.ModalDialog.showModalDialog(options);
}
1

1 Answers

0
votes

Is it not as simple as

  • Create a copy of your function CloseCallbackNew called CloseCallbackNewSecond
  • Change OpenSecondPopup to reference this new copy instead of the original
  • Add a call to OpenSecondPopup at the end of CloseCallbackNew, referencing the dialog result so as to only call it if the user clicked YES

It seems like this should call the second popup when the first is closed.