How to use ConfirmPanel without User Action

 

The user action with confirm uses the User Control Confirm Panel. Below I show you an example of how this user control is the one that has the modal functionality.

From a Web Panel you must start by generating a User Control.

In a WebPanel's Patterns tab, the User Control Properties dialog for the "MostrarDetalle" control is open, listing Width 300, Height 120, Confirm Type YesNo, and Body Type WebComponent; the Properties panel on the right shows the userControl MostrarDetalle using DVelop.GXBootstrap.ConfirmPanel with its User Control Properties list.

Then creating an empty Web Component and also a User Action.

Now go to the Web Panel events and create the following:

 

GeneXus Web Panel Events code editor for WebPanel1/WebComponent1, with a red box highlighting three generated event blocks: Event 'DoMostrarDetalleBtn' calling MostrarDetalle.Confirm(), Event MostrarDetalle.OnLoadComponent assigning WWPAux_WC.object = WebComponent1.Create(), and Event MostrarDetalle.Close calling Refresh.

To clarify, the WWPAux_WC is the name of our empty WC.

 

 

We can see in the first image all the necessary controls, firstly a WebComponent, and secondly the ConfirmPanel. We also highlight the different properties of the confirm, such as the buttons that you want to implement (it can be none), and the type of body, which can be a webcomponent or html. Finally, the added user action is only a button to call ConfirmPanel.Confirm(), but it is not necessary, the idea is that .confirm() can be executed from any event.