File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts parent & popup window with validator framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts parent & popup window with validator framework " Watch "Struts parent & popup window with validator framework " New topic
Author

Struts parent & popup window with validator framework

Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

Hi,

All the below steps are working fine. But the problem is parent screen gets refreshed though the field validation fails(showing alert box).

[1] Parent window with add button
[2] Click 'Add' button
[3] Opens 'Add' Popup window with some fields and 'Save' button
[4] User enter values and click 'Save' button
[5] Validate the fields using struts validator framework(client side validation)
[6] Once validation success corresponding action needs to be executed & update the data in database
[7] Parent screen needs to be refreshed without closing the popup screen

Please refer the related code snaps below,

'Save' button JSP syntax


Javascript function for 'Save' button


struts-config.xml

<action name="CFSRuleAddEditForm" path="/rsave" scope="request"
type="SaveAction"
input="/WEB-INF/com/gui/pages/popup/AddPopup.jsp"
validate="true">
</action>


The parent screen getting refreshed always irrespective of the validation result. The parent screen should be refreshed only the validation success. I understood since the parent screen form is submitted in javascript function, the parent screen is reloaded if validation fails also. Please share your suggestions to resolve this issue.

If more clarifications are required, please revert back.

Thanks
Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

Can anybody suggest for this topic?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts parent & popup window with validator framework