How do you update a TextField from a grails remoteLink?

Posted by Randyaa on Stack Overflow See other posts from Stack Overflow or by Randyaa
Published on 2010-03-18T13:16:48Z Indexed on 2010/03/20 17:31 UTC
Read the original article Hit count: 364

Filed under:
|
|
|

Existing markup:

<g:textField name="identifier"/>
<g:remoteLink action="newId" update="identifier">generate new id</g:remoteLink>

Corresponding HTML markup:

<input type="text" id="identifier" name="identifier">
<a onclick="new Ajax.Updater('guid','/webapp/domain/newId',{asynchronous:true,evalScripts:true});return false;" href="/webapp/domain/newId">generate</a>

The HTML markup it generates when the link is clicked:

<input type="text" id="identifier" name="identifier">THE-NEW-ID-HERE</input>
<a onclick="new Ajax.Updater('guid','/webapp/domain/newId',{asynchronous:true,evalScripts:true});return false;" href="/webapp/domain/newId">generate</a>

© Stack Overflow or respective owner

Related posts about grails

Related posts about AJAX