Thursday, May 5, 2011

Ajax in grails

<g:javascript library="prototype" />

<g:remoteLink action="showDetail" id="${messageInstance?.id}"
update="details" >

${} - ${messageInstance.subject}


The final attribute that we

set on the <g:remoteLink> tag is update. This attribute contains the ID of the HTML element on this page that will be updated with the result of the action—in this case, details.

In the method in action

def showDetail = {
def messageInstance = Message.get(
if (messageInstance) {
render(template:"details" , model:[messageInstance:messageInstance])
else {
render "No message found with id: ${}"

No comments:

Post a Comment