This content has been marked as final.
Show 4 replies
-
1. Re: Question: how to make confirmation box work with h:comma
dustismo Jun 18, 2007 2:08 PM (in response to anescu)This seems like a roundabout way to get what you want.. I believe the following will do what you are looking for:
<h:commandLink id="delete" action="#{abcHome.remove}" onclick="return confirm('Do you want to delete this entity?');"> #{messages['general.delete']} </h:commandLink>
-
2. Re: Question: how to make confirmation box work with h:comma
dustismo Jun 18, 2007 2:16 PM (in response to anescu)I just read that wiki link you left, and judging by that I'm guessing that my solution won't work (and you probably tried it anyway).
-
3. Re: Question: how to make confirmation box work with h:comma
anescu Jun 19, 2007 3:04 AM (in response to anescu)Yes,
I have tried it, as it was suggested in the Wiki and it does absolutly nothing. That is why I suspect a Seam bug around there (I suppose the Wiki is correct and works for a normal JSF application). -
4. Re: Question: how to make confirmation box work with h:comma
anescu Jun 19, 2007 3:24 AM (in response to anescu)Hi,
Mea culpa...
The solution in the Wiki does work after all. I deleted the action by mistake. But the solution you proposed doesn't work, the code in the onclick attribute is placed first in the JS generated code, so if you do something likeonclick="return confirm('Question...');"
the rest of ther script will never fire.
So this solution works after all:onclick="if (!confirm('Are you sure you want to delete this record?')) return false;"