-
Book Overview & Buying
-
Table Of Contents
Grails 1.1 Web Application Development
By :
Our users have expressed a desire to be able to change the tags for files and messages once they have been posted. There is no need to update the contents of messages, and we can already upload new versions of files. There should be no need to send users off to another page just to update the tags for a message or a file. We can use the built-in Grails support for AJAX to allow our users to edit their tags inline.
Grails uses the Prototype framework (http://www.prototypejs.org) to provide built-in AJAX support. The remoteLink and formRemote Grails tags provide all the AJAX support we need to start editing tags inline.
The remoteLink tag allows us to:
Call an action asynchronously
Update a given HTML element on success or failure
Register JavaScript functions to be called before or after the action has been executed
Register JavaScript functions to be called when certain events are fired
For our basic example, we only need to use the first two features — calling...
Change the font size
Change margin width
Change background colour