While developing the sample ajax grails application which is available on github, I encountered this problem on g:remoteLink
Everything works good, but if I need to add a delete confirmation on the
<>, the confirmation dialog appears but g:remotelink still goes ahead and compeltes the ajax call even if the user has selected the
<> action="ajaxdelete" id="${contact.id}" before="return confirm('Are you sure?');" update="contactsElement">Delete
Jeff Brown at Spring Source. and his friend Rhyolight, lead developer on GrailsUI, Helped put a wonderful soluction to get around this problem.
Solution is to use Grails UI (Yui plugin), as grailsUI has this wonderful capability to passthrough the config params which grails does not understand it works well.
Here is what the above code was replaced by
< gui:dialog
title="Please confirm!"
width="300px"
triggers="[show:[type:'link', text:'Delete', on:'click']]"
controller='contact'
action='ajaxdelete'
update='contactsElement'
params="[id:contact.id]"
form="true">Are you sure you want to delete ${contact.name}?</gui:dialog>
Looks like grails UI is very powerful to be ignored.