Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Handle exceptions on submit

UserPost

22:46
16/05/2012


bogoa666

Malaga (Spain)

Member

posts 21

Hi,

I want to know how to handler exceptions in server side on submit. For example, i have an add form and i want to show an error if the object that represents this form is repeated. A person with the same passport.


Thanks

16:23
18/05/2012


bogoa666

Malaga (Spain)

Member

posts 21

Post edited 16:25 – 18/05/2012 by bogoa666


Seems like I should use the afterSubmit form event. The documentation is here for other people who was interesting in: http://www.trirand.com/jqgridw…..rm_editing

I'll try to solve my problem and post it here

16:20
24/05/2012


bogoa666

Malaga (Spain)

Member

posts 21

Post edited 16:22 – 24/05/2012 by bogoa666


Hi, at the end, the event i need was 'errorTextFormat' to catch the response message but how? I will explain my solution for adding an item to my table:

jQuery (client)

              jQuery("#mytable_table").navButtonAdd('#mytable_pager', {caption: "", title: "Add", buttonicon: "ui-icon-plus", position: "first",
                  onClickButton: function() {
                      jQuery("#mytable_table").jqGrid('editGridRow', "new", {jqModal:true, modal:true, reloadAfterSubmit:true,
                          closeAfterAdd:true, jqModal: true, recreateForm:true, top: 200, left: 520, width: 400, height: 160,
                          errorTextFormat: function (response) {
                            if (response.status != '200') {
                                return 'error: ' + response.responseText;
                            }
                            else {
                                return 'Save ok!'
                            }
                          }
                      });                           
                  }
              });

JAVA (server)

response.status = 300; // any status code different to 200
response.print("my error message");


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

28 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9576

Posts: 28740

Membership:

There are 10029 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (6995 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information