Displaying Extension Library Dialog box when page loads?

浪尽此生 提交于 2020-01-22 02:36:06

问题


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


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/21101662/displaying-extension-library-dialog-box-when-page-loads

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!