Grails: use of <g:select>
I am stuck on something which seems really simple, but apparently is not :) Thanks in advances for any help, any attempt of solution is most welcomed.
My problem is the following: My .gsp view:
<td>
<g:select from="${creditProviders}"/>
</td>
My .groovy controller method:
def simulate = {// Need to provide the list of credit providers
def creditProviders = CreditProvider.findAll()
[ creditProviders : creditProviders ]
}
The error I get:
Error processing GroovyPageView: Error executing tag <g:select>: null at /pathTo the view
So I do not manage to populate my tag for so开发者_如何学Pythonme reason... I can call my ${creditProviders} variable outside the tag and it works like a charm. I am stuck, and do not understand what is wrong.
Wish you a good day :)
Your <g:select>
probably needs a name
attribute. Try:
<g:select name="something" from="${creditProviders}"/>
Unfortunately you have been runnning into a known issue in grails 1.3.7. You need to define the name
-tag. If you don't, you get this meaningless NPE. This bug is fixed in grails 2.0 ( http://jira.grails.org/browse/GRAILS-7656 ).
Good luck ;)
精彩评论