Reset SimpleForm after submit

Tagged:
  • Finn Feldmann
    Participant
      Has successfully completed the online course Introduction
    1 year, 2 months ago #44296

    Hi everyone,

    I’m fairly new to Simplifier and I’m struggeling a little bit with understanding the logic in Simplifier Designer / Process Designer. I have build and Order-App. After submitting the filled order form I want to reset the the form so that all fields are empty again and I can make a new order. I can’t find a setting to reset the form? What is the way to go?

    Would be nice to get some hints.

    Thanks,

    Finn

    Jan-Niklas Böhnke
    Participant
      Has successfully completed the online course Introduction
      Has successfully completed the online course Basics (100)
    1 year, 2 months ago #44447
    Up
    0
    Down
    ::

    Hi Finn,

    if you use a global variable in order to store your users input. You can simply reset

    this global variable after saving the previous entry into your DB. This you can do either via a UI Action shape or via script.

     

    Armin Winkler
    Moderator
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
    1 year, 2 months ago #44482
    Up
    0
    Down
    ::

    Hi Finn,

     

    in addition to Jan-Niklas’s reply, I would differentiate two cases in general:

     

    • You don’t use property bindings to a variable in your form: In that case, the easiest way to reset all form fields after submission is to use a UI action that maps a constant empty string to all the ‘value’ or similar properties of the field widgets
    • You have all the input fields in your form bound to a variable (or possibly multiple variables): In that case, you can proceed as Jan-Niklas suggested, and empty that variable instead. This can be done via UI action in the same way as described above by mapping an empty string constant to the variable fields. I would generally recommend using the UI action for this approach as it does not require coding in JavaScript and it should be more efficient to configure it this way. Alternatively though, you can indeed also set the field widgets empty via scripting. You would then have to call the respective widget methods from OpenUI5

     

    If you are not satisfied with the proposed solutions, then please feel free to create a feature request in our Ideas portal so we can make dealing with this use case even easier for you. I think, a widget property on the level of the form itself that automatically empties all fields nested inside would be a valid and good improvement in our standard widget. We would appreciate if you create a feature request for it in our portal. Thank you in advance!

     

    Kind regards,

     

    Armin

    Finn Feldmann
    Participant
      Has successfully completed the online course Introduction
    1 year, 2 months ago #44634
    Up
    0
    Down
    ::

    Thanks Jan-Niklas Böhnke and Armin. I went the way Armin described and used the UI action that maps a constant empty string to all the ‘value’ or similar properties of the field widgets. This works for me. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.