register
other register

Wednesday, December 10, 2008

Grails generate-views with all the fields

grails generate-views domainClass

By default, it will generate the list view with the first 6 fields including the primary key (i.e. id).

To tell the grails to generate the list view with all the fields, you can modify the file:

$GRAILS_HOME\src\grails\templates\scaffolding\lis.gsp

Then change the 6 in the "if (i < 6)" to a big number. There are two places to change, one is for the table column headers, the other is the row data.