locked
changing window.location.href in a popup form resets IsPopUI to false RRS feed

  • Question

  • I have a custom ribbon button, which is displayed in Edit form.
    The button navigates user to a different form by setting window.location.href (functionality similar to clicking Edit button in the Display form).
    When clicked the new form opens correctly in the same popup window, but includes the left navigation, site settings and other controls, which should be hidden when opened in a SharePoint popup window.
    I checked on the server side and it appears that SPContext.Current.IsPopUI is at that point false, which explains this, but is obviously wrong.
    Any ideas why or how to implement it differently, so that these controls are hidden when in popup mode?


    • Edited by tsw_mik Wednesday, March 30, 2011 8:52 AM
    Thursday, March 17, 2011 10:30 AM

Answers

  • After many hours of searching...

    The correct method used for navigating to another url from the modal dialog window is...

    STSNavigateWithCheckoutAlert(url)

    • Marked as answer by tsw_mik Wednesday, March 30, 2011 1:25 PM
    Wednesday, March 30, 2011 1:24 PM

All replies

  • I am able to show the form in a popup window, which looks correct by calling:
    SP.UI.ModalDialog.showModalDialog(options);
    but when it's called from a ribbon button, which is visible inside another popup window then it results in two different popup windows, which is not right.
    That's why I'm trying to navigate to another page inside already an opened window.

    I also tried closing the current popup using:
    SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Closing Popups');
    and then open a new popup, but then the new popup fails to fully load.

    Thursday, March 17, 2011 3:01 PM
  • How can I prevent two different dialog windows from appearing?

    Is there some way to control it? I would want to open the second popup in the same window (iframe) if that's possible.

    Wednesday, March 30, 2011 8:57 AM
  • After many hours of searching...

    The correct method used for navigating to another url from the modal dialog window is...

    STSNavigateWithCheckoutAlert(url)

    • Marked as answer by tsw_mik Wednesday, March 30, 2011 1:25 PM
    Wednesday, March 30, 2011 1:24 PM
  • Thanks a lot tsw_mik ! Works like a charm..

    shweta

    Thursday, March 22, 2012 10:00 AM