Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Handle exceptions on submit
16/05/2012
22:46
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

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

18/05/2012
16:23
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

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

24/05/2012
16:20
Avatar
bogoa666
Malaga (Spain)
Member
Members
Forum Posts: 21
Member Since:
23/09/2010
sp_UserOfflineSmall Offline

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");

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information