Dijit dialogs in sequence ... first is modal, second is not

  • I have multiple dijit dialogs on a XPage, most of which pop when buttons are clicked. One is an “are you sure?” type dialog that pops on save. The dialogs that pop on buttons work fine, apparently “stopping” execution until the user interacts with them, which is the desired behaviour. If a save is being done the nag dialog pops just like it should, but it’s not “modal”, ie, it doesn’t halt everything until the user answers. The browser keeps running in the background, the save takes place, and this dialog is left “hanging” there. (grin)

  • I’m sure I’m just missing some parameter, and the most likely scenario is that the dialogs that pop on buttons are actually not “modal” either, but because the browser isn’t doing anything, like trying to save and exit, that operation isn’t noticable. I surmise this because all the dialogs use exactly the same code on a function in a JS library. That’s short:

function showMe(dlgName, dlgTitle) {

var dlg=dijit.byId(dlgName);

if(dlg) dlg.show();

else {

	dialog_create(dlgName, dlgTitle);

	dlg=dijit.byId(dlgName);

	if(dlg) dlg.show();

	else {

		alert(dlgName+" explicit create failed");

		return false;

	}

}

return true;

}

  • I’ve search here but not found, though that could easily be the parameters. I’ll go poke around the 'net some and see what I can find.

Meantime if someone knows the answer I’d be much obliged…

Subject: re: dijit dialogs in sequence

hi david,

i hope that i understood your question the right way.

eventually that’s a behaviour according to the functionality of dojo/dijit. 'cause dijit uses only one underlay for all created dialogs and the underlay controls the modality of the dialogs. you could use firebug to see, if the underlay changes (the underlay is rendered as a

-tag with an id like e.g. id=“dijit_DialogUnderlay_0”).

hope this helps you.

Subject: Thanks Benjamin…

  • I would think if it’s using one underly, then all dialogs would be modal, which is the desired behaviour. Instead the first appears to be modal and the second does not.

  • I think it may be that the XPage is not actually waiting for the client-side code to execute before triggering the simple action. I don’t know how to mimic that simple action in code or I’d move that functionality from a simple action to code.

  • Instead, based on my premise, I took the off the button that pops the second dialog. When that dialog returns I programmatically “click” a hidden button that has the on it. I’m in the middle of doing that now to see what it does.

  • But it’s possible I have not understood your response. If so feel free to illucidate … I feel I am at least not understanding the bit about checking the underlay in FireBug, ie, what am I looking for on a div with a similar ID to your mention?

Thanks for your time…