[Dojo-interest] non-blocking modal dialog

41 views
Skip to first unread message

cpanon

unread,
Nov 16, 2011, 6:34:36 AM11/16/11
to dojo-i...@mail.dojotoolkit.org
Hello
1. How does one remove a dijit.Dialog?
2. How does one eliminate the close box? I just want a "Please wait", yes
I know anti-web2.0, but narrowly necessary.
3. Is dijit.Dialog non-blocking? I need background updates and detail to
still happen, just alert the user and prevent from closing the waiting box.
tia.

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3512382.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

David Raab

unread,
Nov 16, 2011, 7:07:36 AM11/16/11
to dojo-i...@mail.dojotoolkit.org
var dialog = new dijit.Dialog({
content: 'Please Wait...'
});
dialog.show();

> 1. How does one remove a dijit.Dialog?

dialog.hide();
dialog.destroyRecursive();

> 2. How does one eliminate the close box? I just want a "Please wait", yes
> I know anti-web2.0, but narrowly necessary.

It seems, that's not possible. There exists a "closable" attribute, but
setting it to "false" does not remove the Close Button.

> 3. Is dijit.Dialog non-blocking?

Yes, it is.

Rags

unread,
Nov 16, 2011, 8:45:32 AM11/16/11
to dojo-i...@mail.dojotoolkit.org
On 11/16/2011 6:34 AM, cpanon wrote:
> Hello
> 1. How does one remove a dijit.Dialog?
> 2. How does one eliminate the close box? I just want a "Please wait", yes
> I know anti-web2.0, but narrowly necessary.
---
It has an attacheNode if I recall; we extended Dialog to allow us to
manage this with a constructor parm.
---

> 3. Is dijit.Dialog non-blocking? I need background updates and detail to
> still happen, just alert the user and prevent from closing the waiting box.
> tia.
---
For a simple Please Wait box we wound up not using dijit at all, but
making an old school div/veil that's hidden, and unhiding it when
needed. It's very lightweight and requires only dojo core.

Hope this helps...

- Rags
---

cpanon

unread,
Nov 16, 2011, 9:56:23 AM11/16/11
to dojo-i...@mail.dojotoolkit.org
Thank you both.
However I am having problem loading it. These are my statements
<script src='&lt;html:rewrite
page=&quot;/pages/js/dojo/dojo/dojo.js&quot;/>' type="text/javascript">
dojo.require("dijit.Dialog");
</script>
<script src='&lt;html:rewrite
page=&quot;/pages/js/dojo/dijit/dijit.js&quot;/>'
type="text/javascript"></script>
<link href=&quot;&lt;html:rewrite
page=&quot;/pages/js/dojo/dijit/themes/tundra.css&quot;/>" rel="stylesheet"
type="text/css"/>

when my onLoad executes a function which calls:


var dialog = new dijit.Dialog({

title: "Loading...",
content: "Please wait.",
style: "width: 300px"
});

I get dijit.Dialog() is not a constructor. I am loading prototype,
blackbird, dwr, and other libraries this way wop. Can you clarify why this
constructor message(I have searched) and how to fix?

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3512902.html


Sent from the Dojo Toolkit mailing list archive at Nabble.com.

cpanon

unread,
Nov 16, 2011, 12:36:26 PM11/16/11
to dojo-i...@mail.dojotoolkit.org
Update
When I try it this way:
dialog = dojo.getObject("dijit.Dialog");
new dialog({

title: "Loading...",
content: "Please wait.",
style: "width: 300px"
});
dialog.show();
I get "Dialog is not a constructor."
Or if I try this:
var thing = "dijit.Dialog";
// check it out first:
if(!dojo.isFunction(thing)){
thing = dojo.getObject(thing);
}
dialog = new thing({ title:"bar" });
dialog.show();
I get "thing is not a constructor"

I am out of syntax attempts. Any ideas/answers?

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3513385.html

ben hockey

unread,
Nov 16, 2011, 12:39:51 PM11/16/11
to dojo-i...@mail.dojotoolkit.org

// load the code for the dialog
dojo.require('dijit.Dialog');

// wait for the code to be ready
dojo.ready(function () {
// now dijit.Dialog will exist
var dialog = new dijit.Dialog({ ... });
});

cpanon

unread,
Nov 16, 2011, 1:53:25 PM11/16/11
to dojo-i...@mail.dojotoolkit.org
Hi
Thanks.
Obviously I "jumped-in" without reading. That must be a standard pattern.
What else should I minimally read so as not ask RTFM questions in the
future?

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3513600.html

cpanon

unread,
Nov 17, 2011, 6:27:07 AM11/17/11
to dojo-i...@mail.dojotoolkit.org
Hi
Sorry to bother, but there is still something wrong. All that I see is text
in the middle of the screen. Very odd, as though it is for character
displays. Any idea? Is it a z-order issue? The text from the parameters
is there but no graphics. Someone must have seen this before? I cant be
that "unique". Thanks for any insight anyone.

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3515465.html

samc0de

unread,
Nov 17, 2011, 6:53:32 AM11/17/11
to dojo-i...@mail.dojotoolkit.org
check for transparency of the dialog

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/non-blocking-modal-dialog-tp3512382p3515516.html

David Raab

unread,
Nov 17, 2011, 6:56:23 AM11/17/11
to dojo-i...@mail.dojotoolkit.org
On 11/17/2011 12:27 PM, cpanon wrote:
> Hi
> Sorry to bother, but there is still something wrong. All that I see is text
> in the middle of the screen. Very odd, as though it is for character
> displays. Any idea?

Did you load the "claro" css file. or tundra or whatever theme you are
using *AND* did you add class="claro" on your <body> tag?

Reply all
Reply to author
Forward
0 new messages