Delete button with alert

I have a table with all records and for each record a button link to the page for delete record
To insert an alert with confirmation request, where should I intervene and how? On the button or on the delete page?
Thank You

This came up in a thread recently (I haven’t managed to find it).

I mentioned that I use a modal to display a delete confirmation message (triggered from a delete button). I also mentioned that I sometimes like to give the option of deleting without confirmation - and I was setting this (non-default) option in another modal (where other options could be set).

I thank you, I’m going to look for it

TomD I do not find your post
Now the problem remains. I could intervene on the code but I would like to know if is possible with Wappler to insert a warning message before the delete operation

I use modals for my deletes. I had the delete to a detail region within the modal. I even take it a step further and add a simple checkbox with required validation. So now the user needs to click the delete button and a modal opens up with a confirmation message and they must also click the checkbox to actually delete the record.

3 Likes

Hi @brad…
very nice and inspiring!! thank you for sharing.

How do I link the “delete button” (link relative to the single record) to the modal with the ID, and then from the modal transmit the confirmation with ID?
Because if I open the modal I lose the connection to the record

As Brad says it’s certainly possible - and because of the control we have in Wappler, you can do it in different ways (including the nice example from Brad).

I created the screenshots I included on 21 September, but I can’t find the post either. In the example I gave, I show a modal to confirm deletion, by default:

image

… but gave an option to turn this confirmation off:

It’s quite straightforward to do. I created two delete buttons with display conditions: if the checkbox is selected, the button displayed is attached to the delete action (and is inside a form); otherwise the button displayed is set up to show the confirmation modal. In the second case, I use the data detail feature, passing the record ID:

There are other ways to do this, but this works well and no query is needed to display the selected record. I don’t know if there is any Wappler documentation on Data Traversal etc., but there are some good demos on the DMXzone site.

2 Likes