my dog learned polymorphism*
The moose likes Struts and the fly likes Displaying a pop up dialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying a pop up dialog " Watch "Displaying a pop up dialog " New topic
Author

Displaying a pop up dialog

veena sasikumar
Greenhorn

Joined: Nov 27, 2006
Posts: 29
Hi,
I have written a class for validating datas and I am calling this method for validating the "from" and "to" date fields of a form(MyFirstForm) in an Action's execute method. I want to
1) display error in the first jsp itself when the validation fails.
2) pop up a dialog with values fetched from data base between the dates if the validation passes.
The first part was done easily by throwing errors and displaying the same.
How can I get a pop up dialog ( say model dialog) when the validation succeeds.

I have written one more jsp which can be used for displaying in the popup window. But how can I get a pop up model dialog?

thanks and regards

veena
Mandar Velankar
Ranch Hand

Joined: Jul 31, 2006
Posts: 32
According to me you may write separeate javabean which have some property say msg & getter/setter method to retrive or store value . You can set your
retrive values by setting msg in above javabean. put javabean in request scope e.g request.setAttribute("testBean", testBn);
now on next page which will be displayed write javascript function on onLoad event handler of your form and pass to the function value by using <bean:write> tag which will retrive set value.Display the passed value using alert().
Try it out , it works I tested that.

Regards
Mandar Velankar
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying a pop up dialog
 
Similar Threads
Getting teh same JSP
Opening pop up in JavaScript
Focussing text fields depending on ActionErrors in struts 1.0
Java Swing JOptionPane Question ?
Problem on Cross domain XMLHTTPRequest