Quantcast

correct id doesn't get pass.....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

correct id doesn't get pass.....

kumudu
In my project i have a work flow like this..
There's a organization , it has contact information, and then that contact information contains Coordinator and IT administrator informaiton.

My domain classes are as follows.

class Organization {

    Category category
    SubCategory subCategoryName
    String organizationName
    Organization parentOrganizationName
    String toString(){return ' '+organizationName}
   
    static hasMany=[userInformations:UserInformation,
        contactinformations:ContactInformation,
        itInfrastructureInformation:ItInfrastructure,
        remarksdetails:Remarks]

    
    static belongsTo =Category

    static constraints ={
        category()
        subCategoryName(nullable: true)
        organizationName(blank:false)
        parentOrganizationName(nullable: true)
        contactinformations()
        userInformations()
        itInfrastructureInformation()
        remarksdetails()
    }


}






class ContactInformation {

    Organization organization
   
   
    static hasMany =[coordinators:Coordinator,itAdministratorInformations:ItAdministratorInformation]
    String toString(){return 'Contact Information of- '+ organization}
    static belongsTo = Organization

    static constraints = {
        organization()
        coordinators()
        itAdministratorInformations()

    }
}


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()
     
    }
}


When I run the app, first i create organization. For ex- Finance Ministry.
then I go from that to create contact Information, there i get the return organization as 'Finance ministry', and create contact information. Then go from that to create Coordinator information. There i have the instance of the contactInformation domain class, it should display the 'Contact Information of - Finance ministry' in its drop down list. But it just give the drop down in the order of i have inserted organziations before, not according the work flow i was going.

I tried to print the value passed to the create.gsp of Coordinator for contact Information, but it doesn't pass any value there, that's why it gives the drop down in the order of organizations i inserted.

please give me a solution for this to get the correct id to there.

regards.
kumudu


New Email names for you!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
Loading...