Confirm Panel

WorkWithPlus provides the possibility to create actions that need user confirmation in order to execute some operations. It can be useful for developing actions that update records in database or are irreversible, in order to minimize user errors (clicking by accident to some action for example).

In order to describe this feature, we take Person instance as an example. We add a UserAction named UserActionPrint, like we appreciate below:

The Person transaction's Patterns tab has WorkWithPlus applied, showing the Selection (Person) tree with TableMain, TableHeader, TableActions, and an Action Group listing Standard Actions Insert, Export, ExportReport, EditColumns, and the highlighted User Action (UserActionPrint); below are TableRightHeader with ManageFilters, an Error viewer, and a Grid with PersonId, PersonName, PersonAge, PersonEmail, and PersonHomeAddress.

We set Confirm as True and fill Message, Title and Type properties:

The Properties panel for the userAction UserActionPrint shows Caption "Print Records", Name "UserActionPrint", and a Confirmation section with Confirm set to True, Message "Are you sure you want to print all the records?", Title "Print Person Records", and Type "YesNo", followed by Responsive Customization visibility flags and a Grid Multi Row Selection setting of False.

Now we have develop the associated events. "DoUserActionPrint" event will invoke the Confirm action which will open the confirmation pop up. After application user selects some option of the pop up (Yes, No, Cancel) the event Dvelop_ConfirmPanel_BtnActionPrint.Close will be executed where GeneXus developer should determine what to do in each case (user selected Yes, or No, or Cancel if applies).

Code editor showing the 'DoUserActionPrint' event calling DVelop_ConfirmPanel_UserActionPrint.Confirm(), and below it the DVelop_ConfirmPanel_UserActionPrint.Close event, which checks If DVelop_ConfirmPanel_UserActionPrint.Result = !'Yes' before executing Do 'Do Action UserActionPrint'.

Finally we visualize this action at runtime:

A running WorkWithPlus web app for Person lists one record (Marco Fiorito) with the "Print Records" toolbar button highlighted; an arrow leads to the "Print Person Records" confirmation popup asking "Are you sure you want to print all the records?" with Si/No buttons, and a callout explains that selecting Yes or No triggers the Dvelop_ConfirmPanel_UserActionPrint.Close event.

A Comment/Observation field can be added to the 'Confirm Panel', as it is displayed in the following link: Observation field in 'Confirm' feature

Also, the button to be focused by default can also be set, as explained here