Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

In GWT Alert Message Box issue

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my servlet class I am pushing a GWT Message Box when I get an exception. This Message Box contains one OK button after user clicks on OK login Page will be displayed to the user. But in reality, what is happening is after clicking OK button in Message box again same MEssage Box is coming back and Login Page is not displayed. Issue is resolved when we manually clear cache in browser and reload page. Any fix?
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect the problem lies in the asynchronous nature of JavaScript. A regular JavaScript message box will stop browser execution, but a GWT message box does not; your script continues to run.

Try using "console.log" for your exception messages instead of a message box.

Moving to HTML/JavaScript forum.
 
Rajesh Prabhu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I need to intimate end user with message box.
 
J. Kevin Robbins
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you use a regular JavaScript message box, or a jQuery dialog?

I'm not familiar enough with GWT to help much with this one. Maybe Bear can help when he gets here in a couple of hours.
 
Rajesh Prabhu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay Thank you
 
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry cannot help. My view of GWT is a pretty low one. I have moved this tot he GWT forum where those familiar with GWT might see this.
 
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rajesh Prabhu wrote:
In my servlet class I am pushing a GWT Message Box when I get an exception. This Message Box contains one OK button after user clicks on OK login Page will be displayed to the user. But in reality, what is happening is after clicking OK button in Message box again same MEssage Box is coming back and Login Page is not displayed. Issue is resolved when we manually clear cache in browser and reload page. Any fix?


To start with MessageBox is not GWT but rather GWTX.
Did you try switching to Window#alert() ?
 
Rajesh Prabhu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have tried but it's not working. I am getting Alert Box again and again and it's not redirecting to login page. I am getting same Alert Box.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your SSCCE so we can take a look
 
Rajesh Prabhu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it is,





 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rajesh Prabhu wrote:Here it is,







I wrote:Did you try switching to Window#alert() ?


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!