JSDO saveChanges onSubmit event of edit page

Posted by mihai_neagoe on 16-Oct-2013 06:16

Hi,
I have a problem when trying to save some changes made in jsdo onSubmit event of a page.

I added a javaScript component in Edit page and called a function in it onSubmit event. Inside the jasvascript function I am updating a record and I want to save it. It seems that the saveChanges call from jsdo is not called. I assume this has to do with saveChanges beeing called asyncrous. By putting an alert message after the saveChanges call it works ok. Is there a way arround this?

All Replies

Posted by egarcia on 16-Oct-2013 09:40

Hello,

Here are some suggestion to help you debug the issue.

You could use the Web Inspector/Developer Tools in your web browser and confirm whether the saveChanges call from the JSDO is called. saveChanges corresponds to a PUT request.

Also, you could add subscribe to an afterSaveChanges event so that a function is called when saveChanges() completes.

You mentioned that the code seems to work if you have an alert message after the saveChanges call. Is the saveChanges call the last line in the script? What happens if you have any other code there?

I hope this helps.

Posted by mihai_neagoe on 17-Oct-2013 02:31

Hi,

When using the alert after saveChanges I get a POST request which does not appear when calling the saveChanges without alert. Also I subscribed to afterSaveChanges event and loged the success of the request- this is true only by using the alert.

The code is inside a javaScript function called onSubmit event  from Edit page

Posted by mihai_neagoe on 19-Nov-2013 01:55

Correction: there is a PUT request, but the success of the request (loged in afterSaveChanges callback) is still on false. Is there any idea I could try?

This thread is closed