File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Displaying a pop up dialog

veena sasikumar

Joined: Nov 27, 2006
Posts: 29
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

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.

Mandar Velankar
I agree. Here's the link:
subject: Displaying a pop up dialog
It's not a secret anymore!