small medium large xlarge

Back to: All Forums  Grails
Generic-user-small
10 Jan 2010, 10:18
laurent laborde (1 post)

Friendly greetings ! I’m using grails-1.2.0

i have the following code in domain/TekEvent.groovy :

    static constraints = {
            name()
            city()
            description(maxSize:5000)
            organizer()
            venue()
            startDate()
            endDate()
    }

    String city
    String name
    TekUser organizer
    String venue
    Date   startDate
    Date   endDate
    String description
    static hasMany = [volunteers : TekUser ]

    String toString() {
            "$name, $city"
    }

When i go to : http://localhost:8080/TekDays/tekEvent/list The TekEvent List only display the following properties :

“Id, Name, City, Description, Organizer, Venue”

Where are the startDate, endDate, Description and volunteers ? Did i missed something ?

PS : If i click on “Id 1”, however, i have all the fields.

Thank you.

Dklein_tiny_pragsmall
11 Jan 2010, 07:06
Dave Klein (34 posts)

Hi Laurent,

I thought I had mentioned this in the book, but perhaps I didn’t. Grails default scaffolded list view only shows the first 6 columns either in alphabetical order by field name, or in the order that they are listed in the constraints block. This is an arbitrary number and once you generate the code, in a couple more chapters, you can add other fields to the list view and remove any that you don’t want.

It is also possible to modify the templates that Grails uses and change the number of fields shown on the saffolded list view. Check out http://www.grails.org/Artifact+and+Scaffolding+Templates for more info on that.

Have fun, Dave

You must be logged in to comment