Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 0.5.6
-
Fix Version/s: None
-
Component/s: Ajax, View technologies
-
Labels:None
Description
I play around with the bookmark sample and i think i found an inconsistent "NULL" value handling in the GSP "remoteField"
When creating a new bookmark the BookmarkController creates a new empty Bookmark instance:
def create = {
def b = new Bookmark()
b.properties = params
def suggestions = b.url ? getSuggestions(b.url, b) : []
return ['bookmark':b, suggestions:suggestions]
}
In the GSP view you find the following elements:
<g:remoteField action="suggestTag" update="suggestions${bookmark?.id}"...
<input type="text" name="tagTokens" id="tags${bookmark?.id}"...
<div id="suggestions${bookmark?.id}"...
If you look at the generated html source (firefox - view - page source) you see that the NULL value of the bookmark.id field will be handled in different ways. In the update attribute of the remoteField the text 'null' will be added while on other elements the null value will be replaved by an empty string.
new Ajax.Updater('suggestionsnull'...
<input id="tags"...
<div id="suggestions"...
With the following workaround (provided by Peter Ledbrook) in the remoteField definition you get what you want:
<g:remoteField update="suggestions${bookmark?.id ? bookmark.id : ''}"...
Regards
Michael
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits