cancel
Showing results for 
Search instead for 
Did you mean: 

AFP Masthead - How to use NovaDialogBox

SandipAgarwalla
Active Contributor
0 Kudos

Dear All

I am trying to modify the AFP Masthead, need to add a link which will open up a pop up similar to what happens when you click on log off. Seems like the Logoff uses NovaaDialogBox to create the pop up and the buttons have event handlers.

Is there a way I can assign custom event handlers? How do I get access to the event handler? Is there any documentation available?

I am creating the dialog box as such


var aS = NovaDialogBox.createMessageDialogBox("Old Link","This will open the Old Link in a new browser window.",

  'Open',"Cancel", "260", "126");

  AccessibilityManager.setItemOpenerElement(oldLink);

I need to open a new window when the user clicks on 'Open' .... How do I get access to the event handler for Open Button? By default Open button is assigned to Log out action.

Any help here please.

Thanks

Sandip Agarwalla

Accepted Solutions (1)

Accepted Solutions (1)

saar_dagan
Employee
Employee
0 Kudos

Hi Sandip,

Unfortunately the NovaDialog doesn't expose an API for this.

However since it returns the markup it's rather easy to overwrite it.


var myBox = NovaDialogBox.createMessageDialogBox("myTitle","myYesButton","myNoButton",myWidth,myHeight, isDraggable);

var buttonYes = NovaDialogBoxButton.createNovaDialogBoxButton("button_std_yes",yes_button, actionToPerform,"EMPH");

buttonYes.addEventListener("click",function(evt){

     console.log("yes was clicked");

},false);


buttonNo.addEventListener("click",function(evt){

     console.log("no was clicked");

},false);

var buttonNo = NovaDialogBoxButton.createNovaDialogBoxButton("button_std_no",no_button, "NovaDialogBox.closeDialogBox()","STD");

//create container for buttons (you will need to take care of their styling)

var div = document.createElement("div");

div.appendChild(buttonYes);

div.appendChild(buttonNo);

document.getElementById("nova_dialog_box_buttons_pannel_id").innerHTML = div.innerHTML;

Play around with this implementation.

However as I reminded above --- this is not an exposed API --- meaning you will need to handle styling and maybe small issues.

BR,

Saar

Answers (1)

Answers (1)

Former Member
0 Kudos

This message was moderated.