Alexandre Bourlier
Alexandre Bourlier

Reputation: 4118

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 some 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 :)

Upvotes: 2

Views: 1254

Answers (2)

Chris
Chris

Reputation: 8109

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 ;)

Upvotes: 4

Rob Hruska
Rob Hruska

Reputation: 120346

Your <g:select> probably needs a name attribute. Try:

<g:select name="something" from="${creditProviders}"/>

Upvotes: 4

Related Questions