Bruce Stemplewski
Bruce Stemplewski

Reputation: 1343

Displaying Extension Library Dialog box when page loads?

Is there any way to display an extension pages dialog box when my page loads?

Upvotes: 0

Views: 232

Answers (3)

Tim Tripcony
Tim Tripcony

Reputation: 8086

Add a <xp:scriptBlock /> with the following client-side code as its value:

XSP.addOnLoad(function(){XSP.openDialog("#{id:dlgMessage}");});

...just be sure to place the component outside any refresh targets, or it will launch the dialog again after every partial refresh event with a target that includes it.

Upvotes: 2

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

Try adding a dojo.addOnLoad() (in a xp:scriptblock) that displays the dialog using CSJS: XSP.openDialog()

Upvotes: 1

Steve Zavocki
Steve Zavocki

Reputation: 1840

Bruce,

You could use jQuery to 'push' the button on page load.

Try putting this clientside js code in your onClientLoad event

$(document).ready(function(){
    $('a.btn').trigger('click');
});

You will have to load jQuery to use this if you don't already have it loaded. You might also be able to do the same thing with dojo.

EDIT: You might have to modify the selector (the tag and class in the parens line 2) above if not using bootstrap. I would give it a unique class so as not to 'push' any other buttons at the same time.

Upvotes: 0

Related Questions