I'm trying to build a simple Dialog Box, that's all. I used the examples available, albeit for a slightly different purpose, on several websites. Here they are: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Create_a_Picklist_View_in_X-Pages http://www.youatnotes.de/web/youatnotes/wiki-xpages.nsf/dx/How_to_create_a_picklist_style_dialog
What I did: - created dbSomething, the dialog box, as a panel in a custom control with the name ccSomething <xp:div id="dbSomething" style="display:none"> ... </xp:div> - embedded ccSomething in an XPage, at the bottom somewhere - added the onload-code <script language="javascript">
XSP.addOnLoad(function() {dialog_create("dbSomething", "")});
</script> - created and included dialog_create in a separate js-library function dialog_create(id, title1) { var dialogWidget = dijit.byId(id); if( dialogWidget ) dialogWidget.destroyRecursive(true); dialogWidget = new dijit.Dialog({ title: title1, duration:600}, dojo.byId(id)); var dialog = dojo.byId(id); dialog.parentNode.removeChild(dialog); var form = document.forms[0]; form.appendChild(dialog); dialogWidget.startup(); } - added a button to show dbSomething
So far so good, it compiles, but nothing happens when I try to use it. I checked with Firebug, set two breakpoints in the dialog_create function on the first two lines of code inside the function. On loading the page, execution is stopped at the first line, but when I continue it never stops at the second line. Somehow, an error occurs during the dijit.byId("dbSomething")
Do I have to add libraries or other resources to make it work? I did NOTHING else than the above. There is some other XPage in the database that works like a charm, and if I remove these outlines of a dialog box function, the current page works as well.
How can I get this dialog box working?? Or do you have an example of a Dialog Box custom control available that I can include?
Help!!
|