How to display a different (new) section on click of SUBMIT button?

Hi,

I have a editable grid where the user can edit the data on the grid and on click of submit button, data will be saved in DB. Am using writetodatastore entity smart service onclick of submit button. OnSuccess I need to hide the editable grid and display a section with the corresponding message. I tried below code and some thing else also but no luck,

a!buttonLayout(
          primaryButtons: {
            a!buttonWidgetSubmit(
              label: "Submit",
              saveInto: {
                a!writeToDataStoreEntity(
                  dataStoreEntity: cons!DS_ENTITY_REF_EMPLOYEE,
                  valueToStore: local!questionsToUpdate.data,
                  onSuccess: {
                    with(a!richTextDisplayField(
                      label: "Employee's Updated Successfully",
                      align: "CENTER",
                      style: "STRONG"
                    ))
                  },
                  onError: {
                   
                   
                  }
                ),
                local!currentStep
              },
              style: "NORMAL"
            )
          },
          secondaryButtons: {
            a!buttonWidgetSubmit(
              label: "Cancel",
              value: true,
              saveInto: ri!cancel,
              style: "LINK",
              skipValidation: true
            )
          }
        )

Thanks.

Regards,

Balaji.R

  Discussion posts and replies are publicly visible

Parents
  • Hi Balaji,

    When you use a!buttonWidgetSubmit what it actually do is submits your form after saving it value and the process move to the next available node in process model.

    Your requirement is to display the message onSuccess or onError, for that form should not be submitted and to achieve it you can use a!buttonWidget() keeping submit parameter as False.

    But now you have to decide when you want the form to be submitted and process move to next node.
Reply
  • Hi Balaji,

    When you use a!buttonWidgetSubmit what it actually do is submits your form after saving it value and the process move to the next available node in process model.

    Your requirement is to display the message onSuccess or onError, for that form should not be submitted and to achieve it you can use a!buttonWidget() keeping submit parameter as False.

    But now you have to decide when you want the form to be submitted and process move to next node.
Children