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.
Developer, Java Evangelist, extensively worked on Java, GWT, Flex, RIA technologies with enterprise frameworks. I have a privilege to conduct lot of Training/Coaching in Java Technologies, and to connect with real people.
Showing posts with label GRAILS AJAX. Show all posts
Showing posts with label GRAILS AJAX. Show all posts
Tuesday, December 23, 2008
g:remotelink and Delete Confirmation
Labels:
g:remotelink,
GRAILS AJAX,
grails UI
Wednesday, December 17, 2008
Sample application for AJAX and Grails
I am very impressed with the rapid development Grails Offers, the power of AJAX which grails offers has made it even more powerful. Grails offers many AJAX frameworks which can be added as plugins.
I started with a sample ajax in grails application, which demostrates the following capabilities of grails,
Please find a link to sample example, which includes all the scenarious of AJAX.
I started with a sample ajax in grails application, which demostrates the following capabilities of grails,
- g:formRemote : How to use g:formRemote , within and Outside the controller
- g:formRemote along with g:remoteLink for inline Editing
- JQuery Validator Plugin : Demostrates JQuery works with conflicts with ScriptAculo and Prototype
- Grails YUI : Replaced g:remoteLink with grails UI Dialog, for Delete confirmation.
Please find a link to sample example, which includes all the scenarious of AJAX.
http://github.com/markatharvest/sample-ajax-in-grails/tree/master
Please send me any pull requests, if you guys make some changes
Labels:
AJAX,
GRAILS AJAX
Subscribe to:
Posts (Atom)