Technical support This forum is closed.
Version 1.x > Technical support > Document Templates and nested relationship View modes: 
User avatar
Member
Member
Chameane - 12/15/2005 4:38:22 PM
   
Document Templates and nested relationship
Hello,

I've got the following 3 document templates
-Domain
-SubDomain
-Employ

Where:
Domain and subdomain have 2 champs: ID and name
Subdomain is defined as a child template of domain
Employ is another template with 2 dropdown list champs (domain and subdomain)

I want:
To display the second dropdown list in function of the first choice when defining a new document object

Example:
In content module I've got the following tree structure:

-Domain1
--SubDomain11
--SubDomain12
-Domain2
--SubDomain21
--SubDomain22
--SubDomain23
-Domain3
--SubDomain31

In order to define a new 'Employ document', if I select Domain2 in the first Dropdown list, I only want to show SubDomain21,SubDomain22 and SubDomain23 in the second one.


I've tryed:
To make a relationship: I don't know how to define the relationship name in the document template
To define a foreign key: How can I get it automatically (I don't want to introduce by hand the foreign key everywhere)

Hope somebody can help me...

Thanks


User avatar
Guest
admin - 12/20/2005 5:07:00 PM
   
Re: Document Templates and nested relationship
Hello,

Unfortunately, the dependance of one field on another is not supported. However, we could possibly find some workaround for you.

First, could you please write me if you need to store both domain and subdomain in the Employ document or if you could store only subdomain? If so, you could create a custom user control (field type) "SelectSubdomain.ascx" that would render both dropdownlists, but it would return only the selected subdomain that would be selected in the Employ document.

Please let me know if this works for you.

Thank you.

Best Regards,

User avatar
Member
Member
Chameane - 12/22/2005 3:41:59 PM
   
Re: Document Templates and nested relationship
Yes,

I've got to store both.

I'm going to explain a little my structure:

Document Templates:

+Domain
--DomainID
--DomainName
--Other Fields

+SubDomain
--SubDomainID
--SubDomainName
--Other Fields

+Emploi
--EmploiID
--Domain (DropdownList: SELECT DomainName,DomainName FROM CMS_Domain)
--SubDomain (DropDownList nested with the first one)
--Other Fields

I've finally added a new field "Domain" to the SubDomain document template and filled it "by hand" with the DomainID of the right Domain document template and also, I've saved all the subdomains in the content tree under their respectives domains (Maybe this can help us...)

Notwithstanding, I don't know (if it's possible) how to specify as a var for my sql query the Domain field the user has already selected in order to make a query like:

SELECT SubDomainName,SubDomainName FROM CMS_SubDomain,CMS_Domain WHERE [CMS_SubDomain].[Domain] LIKE [CMS_Domain].[DomainID] AND [CMS_Domain].[DomainName] LIKE @FormColumnValue

Hope this explanation could help you to understand the problem...


Thanks


User avatar
Guest
admin - 12/27/2005 4:06:07 PM
   
Re: Document Templates and nested relationship
Unfortunately, as I wrote, this is not supported. You could only create an easier-to-use subdomain list, like this:

Domain 1 -> Subdomain 1A
Domain 1 -> Subdomain 1B
Domain 2 -> Subdomain 2A
Domain 2 -> Subdomain 2B

so that it's easier for the user to find the subdomain.

Best Regards,