We are trying to write a GUI extension to showcase some information to the Editor. For this we show a popup with the required information to the editor, unfortanetly we are unable to add some buttons, our code looks like as followed;
var options = {};
options.className = "question";
options.popupType = $popupManager.Type.MESSAGE_BOX;
options.title = "This is a popup!";
var btnConfirm = {action: "confirm", label: "Yes", showInPanel: false, showInPopup: true};
var btnCancel = {action: "cancel", label: "No", showInPanel: false, showInPopup: true};
options.buttons = [btnConfirm, btnCancel];
var popup = $popupManager.createExternalContentPopup(null, $cme.Popups.MESSAGE_DETAILS.FEATURES, options);
$evt.addEventHandler(popup, "confirm", onCopyConflictPopupSubmit);
$evt.addEventHandler(popup, "cancel", onCopyConflictPopupClosed);
popup.open();
Without adding the options.buttons
we get the popup with a close button. Looking in MessageBoxPopup.js
we see that we can add buttons like above. But when we do that we get below error; Any suggestions on how to resolve this?
Uncaught TypeError: Cannot read property 'focus' of undefined at Tridion.Controls.MessageBoxPopup.focus (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:59) at a (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:55)
Uncaught TypeError: Cannot read property 'focus' of undefined at Tridion.Controls.MessageBoxPopup.focus (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:59) at Tridion.Controls.MessageBoxPopup.Tridion.Controls.BaseModalPopup._handleFocusOutside (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:56) at Tridion.Controls.FocusOutsideMonitor. (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:1) at Tridion.EventRegisterClass.f.executeListener (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:14) at Tridion.Controls.FocusOutsideMonitor.a (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:14) at Tridion.Controls.FocusOutsideMonitor.Tridion.ObjectWithEvents.processHandlers (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:12) at Tridion.Controls.FocusOutsideMonitor.Tridion.ObjectWithEvents.fireEvent (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:12) at Tridion.Controls.FocusOutsideMonitor._doFocusOut (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:50) at Tridion.Controls.FocusOutsideMonitor.a (coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:50) at coreresource_v7.1.0.66.43_.js?sav=1&cnt=core:1