I'm trying to have three different dialogs on as hidden initially, then depending on the response from the ajax form submit, i wish to show different dialogs.
When the form is submitted and waiting for the response, i can show the "in progress" dialog. Then if the server returns an error response, I want to hide the first dialog, then display another dialog depending on the error response type.
I can almost achieve what I want to do except when I hide the first dialog and show the next one, the underlay disappears. If then I scroll inside the browser window, the underlay is displayed properly. I'm doing something simple like this:
dijit.byId("progress_dialog").hide();
dijit.byId("error_dialog").show();
Anyone have suggestions?
I've seen the following page on dojo website, but it seems to be an interim solution for dojo 0.9? http://www.dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/showing-dialog-right-after-hiding-another-dialog-while-keeping-u
any help would be appreciated.
Thanks.
[Edit] okay, I've "solved" the issue by adding a little delay like below.
dijit.byId("progress_dialog").hide();
setTimeout(function() {
dijit.byId("error_dialog").show();
}, 500);
This works for me, but I think there could be a better way of solving it. Any takers?
[Edit again] The version I'm working with is dojo-1.3.2