XPages Compatible Dojo Dijit Dialog

dojo.provide('com.ZetaOne.widget.Dialog');
dojo.require('dijit.Dialog');

(function(){
		dojo.declare("com.ZetaOne.widget.Dialog", dijit.Dialog, {
				postCreate: function(){
					this.inherited(arguments);
					dojo.query('form', dojo.body())[0].appendChild(this.domNode);
				},
				_setup: function() {
					this.inherited(arguments);
					if (this.domNode.parentNode.nodeName.toLowerCase() == 'body')
						dojo.query('form', dojo.body())[0].appendChild(this.domNode);				
				}				
		})
}());





This will allow you to place XPages content within the a Dijit Dialog and perform partial/full refreshes on the data. The component itself moves the dialog back inside the HTML form so that the XSP object can interact with it.

To use, copy into a client-side javascript script library and include on your page.

Construct this just like you would a normal dijit.Dialog by either using dojoType="com.ZetaOne.widget.Dialog" or var x = new com.ZetaOne.widget.Dialog({...});

JavaScript (Client)
Jeremy G Hodge
February 20, 2012 10:06 AM
Rating
233

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



1 comment(s)Login first to comment...
jeniffer homes
(at 07:49 on 19.12.2015)
the component itself moves the dialog back inside the HTML form so that the XSP object can interact with it.