Get your preferred Email name! Now you can @ymail.com and @rocketmail.com. |
|
You must define those pages or their parts as templates, and include them in that "big page"
|
|
In reply to this post by kumudu
You can show as many different objects on a page as you need to. You just have to pass them in from the controller. So, in your controller you can have an action like this:
def bigpage = { def foo = Foo.get(x) def bar = Bar.get(y) def baz = Baz.get(z) [foo:foo, bar:bar, baz:baz] } Then in your bigpage.gsp you could do something like this: <div id=foodiv> foo.property1 <br/> foo.property2 <br/> foo.property3 </div> <div id=bardiv> ... </div> <div bazdiv> ... </div> Or whatever layout you like. You could also do this with templates, as Konstantyn suggested, but you will still need the objects in the model coming from the controller. Hope that helps, Dave On Mon, Jan 5, 2009 at 6:11 AM, kumudu Samarappuli <[hidden email]> wrote:
|
|
What do you mean by foo, Foo, x, property 1 in u'r code.
In my project i have contactInformation domain class. From its show.gsp I need to view show gsp's of coordinator and itAdministrator. My domain classes are as follows. class ContactInformation { Organization organization static hasMany =[coordinators:Coordinator,itAdministratorInformations:ItAdministratorInformation, chiefInnovationOfficers:ChiefInnovationOfficer] String toString(){return 'Contact Information of- '+ organization} static belongsTo = Organization static constraints = { organization() coordinators() itAdministratorInformations() chiefInnovationOfficers() } } class Coordinator extends SystemUser{ ContactInformation contactInformation String organizationAddress String telephoneNo String mobileNo String homeTelephoneNo String fax String toString(){return 'Coordinator -'+ name} static belongsTo = ContactInformation static constraints = { organizationAddress(blank:false) telephoneNo(matches:"[0-9]+") mobileNo(matches:"[0-9]+") homeTelephoneNo(matches:"[0-9]+") fax(matches:"[0-9]+") contactInformation() } } class ItAdministratorInformation extends SystemUser{ ContactInformation contactInformation String telephoneNo String mobileNo String homeTelephoneNo String toString(){return 'IT Administrator - '+name} static belongsTo = ContactInformation static constraints = { telephoneNo(matches:"[0-9]+") mobileNo(matches:"[0-9]+") homeTelephoneNo(matches:"[0-9]+") contactInformation() } } class SystemUser { String name String designation String emailAddress String VOIP String toString(){return ' System users -'+ name +' -'+designation} static belongsTo = Organization static constraints={ name(blank:false) designation(blank:false) emailAddress(email:true) VOIP() } }
|
|
In reply to this post by Konstantyn Smirnov
Get your preferred Email name! Now you can @ymail.com and @rocketmail.com. |
|
read this
|
|
In reply to this post by kumudu
In my example I was just using placeholders since I did not know what your domain model looked like. Foo (uppercase 1st character) is a class, foo (lowercase 1st character) is a variable of type Foo. x is any number representing a valid id of a domain class and property1 represents any property of the class in question.
For your code, since the other objects you need are in a relationship with main object you can do something like this in your contactInformation show.gsp: <g:each in="${contactInformationInstance.coordinators} var="coordinator"> //Within this g:each block you can put any information about the coordinator that you need. You can just copy the code from a generated Coordinator show page. </g:each> Then you can do the same with the itAdministrator. I hope that's a little clearer. Dave On Mon, Jan 5, 2009 at 9:58 PM, kumudu <[hidden email]> wrote:
|
|
Thanks a lot. It works fine
|
| Powered by Nabble | Edit this page |
