Skip to content

dijit.Dialog

maart 23, 2011

ROC Mondriaan is developing a new XPage application for the Ronde om Texel. In the application the content of a PDF, the Notice of Race, has to be displayed to the user who can agree or disagree to it.

As a solution the dijit.Dialog control can be used.

In the example below the code is placed in the onclick event of a Button Control.  In the code there are two callback function defined who modify the content of a Edit Box Control on the XPage.

In the XPages All Properties:

  • basics\resources: define a dojoModule with the name dijit.Dialog
  • dojo: define the dojoForm, dojoParseOnLoad and dojoTheme properties as true

You have to replace “PUT HERE AN IFRAME TAG WITH URL TO PDF” by a <iframe>-tag with the next attributes: src=’URL_PDF’, height=’500′, width=’780′ and  frameborder=’0′.

var dialog = new dijit.Dialog({
 title: "Confirmation Notice of Race",
 content: "PUT HERE AN IFRAME TAG WITH URL TO PDF" +
 "<br/><br/><p style='font-weight: bold'>Have you read the NOR and do you agree?</p>" +
 "<input id='b1' type='button' value='Yes' />" +
 "<input id='b2' type='button' value='No' />",
 style: "width: 800px;"
});

dojo.style(dialog.closeButtonNode, "visibility", "hidden");

var handle1 = dojo.connect(dojo.byId("b1"), "onclick", function(){
 // Your Client-side JavaScript code
 dojo.byId("#{id:inputText1}").value = "yes";

 dialog.hide();
 dialog.destroy();
 dojo.disconnect(handle1);
});

var handle2 = dojo.connect(dojo.byId("b2"), "onclick", function(){
 // Your Client-side JavaScript code
 dojo.byId("#{id:inputText1}").value = "no";

 dialog.hide();
 dialog.destroy();
 dojo.disconnect(handle2);
});dialog.show();

Want to learn more:

XP852 – Lotus Domino Designer 8.5.2 Basic XPage Applications

No comments yet

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit / Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s

%d bloggers op de volgende wijze: