1

We are upgrading our Tridion GUI, and we have some code that pops up a warning when you try to unpublish components that are in use.

The old code is heavily reliant on

 window.dialogArguments

including

window.dialogArguments.unPublishSelection 
window.dialogArguments.unPublishPipeline
window.dialogArguments.unPublishList 

but window.dialogArguments is deprecated and has been removed from most modern browsers. Is there an alternate way of accessing that same information?

2

Your popup should implement a View that extends one of the popup views (e.g. ExternalPopup). And you should open it using the PopupManager, which will allow you to pass those arguments to the dialog -- which can read it using its getDialogArguments() method.

Update: Here's an example from a modal popup window:

Type.registerNamespace("Example");

Example.Popup = function Popup()
{
    Tridion.OO.enableInterface(this, "Example.Popup");
    this.addInterface("Tridion.Controls.ModalPopupView");
    this.addInterface("Tridion.Web.UI.Editors.Base.Views.ViewBase");
};


Example.Popup.prototype.initialize = function Popup$initialize()
{
    var args = this.getDialogArguments();
    console.log("Dialog arguments:", args);
};

$display.registerView(Example.Popup);
  • Thank you very much Peter! This is exactly what I need. I also saw your helpful answer here: tridion.stackexchange.com/a/15546/2601 . I've confirmed that the popup is created using the PopupManager, and I can see the values on the parent window through the manager. But I'm still at a loss on viewing them on the child window --what object has the "getDialogArguments" method on it? Do you have a link to a sample? – sunamc1 Dec 14 '18 at 18:57
  • I updated my answer with an example for a modal popup window. It will work the same from a non-modal popup (e.g. ExternalPopup). The getDialogArguments method is defined in Tridion.Controls.BasePopup so all of the popup controls have it. – Peter Kjaer Dec 17 '18 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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