grails-user - Howto list fields of 2 domains w/ 2 controllers in same .gsp form?

by davidon 2010-07-30T18:38:07+00:00
Hello Grailers all, I have a Grails project that is mostly scaffolded by the generate methods. I have a domain DX and a domain DY. And, I have complementary controllers: CX and CY. I have form fields listed with data from DX and DY in files: x.gsp and y.gsp. Now, I want another file: z.gsp that lists the same fields listed in x.gsp and y.gsp. Anybody have a good Grails way of achieving this task? Pls advise, David.
http://xircles.codehaus.org/manage-email
something like this should work. Use the g:include functionality
prefix the fields in x.gsp as DX.prop1 DX.prop2.
move common fields out to a template -x.gsp
include -x.gsp in x.gsp
do the same for y.gsp
in z.gsp


In your z controller, you can then get the fields via params[ 'DX' ]
for each domain