Getting confirmation from a user in perspective?

Perspective provides a lot more flexibility here.

Here are the basic steps, which you could make as complicated or logic-heavy as you’d like:

  1. Create a View which contains a Label or Markup Component with your “Prefill form” text, and both a “Confirm” and “Cancel” button.
  2. This View should also accept a param of id.
  3. The “Confirm” button should include an onClick Event which invokes a script action (if you’re following my instructions from this thread, then this Script Action should set the session properties which your form fields are bound to).
  4. The “Confirm” button’s script should also include system.perspective.closePopup(id=self.view.params.id) as the final line (this is why the Popup needs to accept a parameter which defines the id of the Popup.
  5. The “Cancel” button should use the same closePopup() function as the “Confirm” button, but that should be all the logic it needs.
  6. Use a valueChanged Event on a field of your choosing to invoke system.perspective.openPopup(view=<a_configured_view>, id=<some_unique_value>, params={"id:":<the_same_unique_value>}, modal=True)

Using these steps should provide your user with a Modal Popup which includes both a confirm and cancel button, where when the Confirm button is clicked you perform your form fill-in logic and then close the Popup, or if "Cancel: is clicked, the Popup will just close and do nothing.

2 Likes