Form Submit Handler and Field Validation - 4.0.4

Posted by IramK on 06-Jan-2016 11:41

Hello,

I have found an issue with field level validation and form submit handler event. Basically I have a field level validation on a lookup selector field based on a condition. There is also a form submit handler event (onsubmit) attached to the page such that when the user clicks on save, the submit handler runs. This works fine when there are no validation errors on the lookup field. However if there is a validation error on the lookup field, the form submit handler doesn't run. Is this is a known issue? Kindly let me know.

Cheers.

Iram

Posted by Mohammed Siraj on 07-Jan-2016 03:59

Yes Iram, in case of server-validation failure re-direction, form submit handlers are NOT being invoked. This is an issue. Will be resolved in 4.0.5 scheduled for Jan 16th.

Posted by Mohammed Siraj on 14-Apr-2016 05:07

Iram, this has already been addressed.

Can you please confirm how are you attaching the handler.

Iram, can you please state how you are attaching a form submit handler.

Request you to try one of these two approaches:

1. Page -> Properties -> onSubmit

2. Add a script component to the page with the following snippet:

rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, function () {

  //Get formContext instance for Edit Form in page

  var formContext = rbf_getObjectRecordForm();

  if (formContext) {

    formContext.addSubmitHandler(onFormSubmit);

  }

});

Also please refer this article for additional details:

community.progress.com/.../22020

All Replies

Posted by Mohammed Siraj on 06-Jan-2016 12:40

Iram, can you please state how you are attaching a form submit handler.

Request you to try one of these two approaches:

1. Page -> Properties -> onSubmit

2. Add a script component to the page with the following snippet:

rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, function () {

   //Get formContext instance for Edit Form in page

   var formContext = rbf_getObjectRecordForm();

   if (formContext) {

     formContext.addSubmitHandler(onFormSubmit);

   }

 });

Also please refer this article for additional details:

community.progress.com/.../22020

Posted by IramK on 07-Jan-2016 03:16

Hello Siraj,

I have both of these separately and this still doesn't work properly. Would it be possible for you to let me know if there is an issue with this please?

Cheers.

Iram

Posted by Mohammed Siraj on 07-Jan-2016 03:59

Yes Iram, in case of server-validation failure re-direction, form submit handlers are NOT being invoked. This is an issue. Will be resolved in 4.0.5 scheduled for Jan 16th.

Posted by IramK on 07-Jan-2016 04:03

Exactly, thanks for confirming that. Is there an alternative way of approaching this? Or I'll leave the code as is for now since it is being fixed in 4.0.5 and would expect it to work in that version. Kindly let me know.

Cheers.

Iram

Posted by IramK on 14-Apr-2016 04:50

Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05],

Has this issue been resolved in version 4.2? I have been testing this but doesn't look like its resolved. Kindly confirm to me.

Cheers.

Iram

Posted by Mohammed Siraj on 14-Apr-2016 05:07

Iram, this has already been addressed.

Can you please confirm how are you attaching the handler.

Iram, can you please state how you are attaching a form submit handler.

Request you to try one of these two approaches:

1. Page -> Properties -> onSubmit

2. Add a script component to the page with the following snippet:

rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, function () {

  //Get formContext instance for Edit Form in page

  var formContext = rbf_getObjectRecordForm();

  if (formContext) {

    formContext.addSubmitHandler(onFormSubmit);

  }

});

Also please refer this article for additional details:

community.progress.com/.../22020

Posted by IramK on 14-Apr-2016 05:38

I can confirm that this issue has been fixed. Thanks Siraj.

Cheers.

Iram

This thread is closed