confirm dialog on removal of grid in a repeated grid

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

confirm dialog on removal of grid in a repeated grid

jteh
Hi,
I have a repeatable grid with several inputs defined in each grid. Is there a way to capture when a user selects the remove option, and display a confirm dialogue? If the user selects yes, the grid is deleted, if they select no, the grid remains.

I can capture the xforms-delete event and display an appropriate dialogue however this appears too late, the grid has already been deleted by the time the dialogue appears.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: confirm dialog on removal of grid in a repeated grid

Alessandro  Vernet
Administrator
Hi,

You're talking about removing one "iteration" (in general one line) from the repeatable grid, correct? I.e. using the dropdown, and selecting "Remove".

Assuming this is the case, you'd most likely have to change grid.xbl to do this. Right now fr-remove is dispatched, and the corresponding iteration just removed. Instead you'd want to show a dialog and upon confirmation do the removal action.

https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/grid/grid.xbl

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet