to check on the server side, I use json response to the event after the transfer, as shown below
navGrid("#pager2",{}, //options {height:280,width:700,reloadAfterSubmit:false}, // edit options {height:280,width:700,reloadAfterSubmit:false, afterSubmit : function(response, postdata) { var msg = "noError"; var res = $.parseJSON(response.responseText); if (res && res.userMessage) { alert(res.userMessage); msg = res.userMessage; } //alert(msg); if(msg == "noError") { return [true, "Validation pass"]; } else { return [false, msg]; } }}, // add options {reloadAfterSubmit:false}, // del options {} // search options );
and column entry
<action name="jsontableEditValidationApartmentResource" class="com.loa.monitor.action.JsonActionResource" method="editValidate" > <result name="success" type = "json"></result> <result name="error" type="redirectAction"> <param name="actionName">proceedApartment</param> </result> </action>
and method of action
public String editValidate() { userMessage = "test msg1"; return "success"; } private String userMessage ; public String getUserMessage() { return userMessage; } public void setUserMessage(String userMessage) { this.userMessage = userMessage; }
Let me know if this is helpful.
Bruce source share