Re: How to make DialogBox modal both in terms of code execution and events?
Thanks for the explanation. Makes sense. Easier to understand for RPC, a bit harder to get for UI events. On Sep 1, 8:56 am, Jason Morris [EMAIL PROTECTED] wrote: This is the way it's done. You can think of JavaScript as running on the event-dispatch-thread. Therefore, opening a DialogBox and making the thread wait until a button is clicked results in the following on the queue: ++ +-+ | wait for click | - | click event | ++ +-+ the wait for click will wait for ever since it never lets the thread move onto the click event task and process the actual event. This is a simplification, but in essence the way it works. I wrote about this problem in terms of GWT RPC... but the principal is the same: http://lemnik.wordpress.com/2008/07/04/gwt-rpc-is-called-aynchronous-... Hope that explains things a bit. lama wrote: I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to make DialogBox modal both in terms of code execution and events?
Iama, under what conditions do you need to use callbacks? Can you give an example? Also, to gwt-user: you may get mouse-down/mouse-up events (which is wrong, but just changes the appearance of a button, or sets focus) but I don't think you can do anything with them (like enter text, or click). Either way, consider a blinder (glass panel, whatever you want to call it) to block the page off (faded or not faded). Ian 2008/9/1 lama [EMAIL PROTECTED] I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris -- Ian http://examples.roughian.com 2B or not 2B, that is FF = Internet communications are not secure and therefore I will not accept legal responsibility for the contents of this message. Any views or opinions do not necessarily represent what I really think unless otherwise specifically stated, and even then, I might still be lying. This message may contain confidential privileged information, but if it does, I've nicked it from someone else. If you have received this email in error then tough, hit delete, and don't bother me about it, I really don't care. Batteries not included. Contents can go up as well as down. Shares can vary in size. May cause drowsiness, if affected, go to sleep. = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to make DialogBox modal both in terms of code execution and events?
I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to make DialogBox modal both in terms of code execution and events?
This is the way it's done. You can think of JavaScript as running on the event-dispatch-thread. Therefore, opening a DialogBox and making the thread wait until a button is clicked results in the following on the queue: ++ +-+ | wait for click | - | click event | ++ +-+ the wait for click will wait for ever since it never lets the thread move onto the click event task and process the actual event. This is a simplification, but in essence the way it works. I wrote about this problem in terms of GWT RPC... but the principal is the same: http://lemnik.wordpress.com/2008/07/04/gwt-rpc-is-called-aynchronous-for-a-reason/ Hope that explains things a bit. lama wrote: I have the same question. I've had to workaround this by adding callbacks to transfer the data from the dialog back to the caller. Regards, lama On Aug 29, 9:16 am, gwt-user [EMAIL PROTECTED] wrote: 1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
How to make DialogBox modal both in terms of code execution and events?
1. To illustrate the first point. In the following code: boolean ok = Window.confirm(Are you sure .); if (ok) { } code inside the if block will be executed only after user presses button on the confirm dialog. Is it possible to do the same with instance of DialogBox? 2. The following code DialogBox dialog = new DialogBox(true, true); dialog.show(); does not ignore keyboard and mouse events for widgets not contained by the dialog Thank you, Boris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---