Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts parent & popup window with validator framework

 
Rajagopal Mani
Ranch Hand
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody suggest for this topic?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic