Home
TeamSite
How to refernce a DCR from a DCR
diamondneil
I have a DCR where there is a list of subjects ( business, education, techm etc ). The user can use this dcr to add and delete these subjects.
Then I have another DCR where the user should be able to select one of the subjects generated in the above DCR. How can I reference the first dcr so that the options appear in a dropdown on the second DCR?
Find more posts tagged with
Comments
Adam Stoller
Either an inline script or a cgi-callout would probably be the way to go.
In either case you'd have to either hard-code in the name of the DCR with the lists or be able to figure it out programmatically so that you can parse the DCR to get the list of items to place into the select list for the calling DCR to use.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cliffhanger
You could do this in multiple way:
1) using database. Deploy the information from the first DCR to a database, then read from the same table at the second DCR. Depending on your requirement, you could either make this a <inline> callout or you could use callServer() to call .ipls to retrieve these values for you.
2)IF you don't want to use Database, you could use simple xml parsing on the first DCR and use the result in the second DCR using either <inline> or callServer.
Adam Stoller
With CallServer being asynchronous, it seems to me to be generally the wrong choice for what is being asked for (and significantly more complex to implement correctly). I think the inline or cgi-callout solutions are much more straight forward.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cliffhanger
With CallServer being asynchronous, it seems to me to be generally the wrong choice for what is being asked for (and significantly more complex to implement correctly).
I agree!! :-)
But that is an option that sometimes a developer might reluctantly have to chose if the requirement demands so. I was not sure at what context
diamondneil
needs this functionality, so thought it was my holy duty to mention
.
diamondneil
Thanks everyone for their help on this subject.
The requirements for this have changed. Now we need eveything in one DCR. So the first dropdown will have subjects( bus, edu, tech, etc). Based on the value selected here I need to draw the values of the second drop down.
Can this be done?
nipper
Sure, easy to do with FormAPI.
Check the tutorials, IIRC there is an example like this.
jbonifaci
Read up on getOptions/setOptions, that will point you in the right direction. You'll either have to do a callServer, or load all of the data into an object when you initialize your form.
diamondneil
Perfect, thanks guys.
Cheers, Neil
diamondneil
One last questions guys.
I am using the following code to make a nested container invisible when the DCT loads:
<script>
<![CDATA[
IWDatacapture.getItem("/index/content/copy[1]").setVisible(false);
]]>
</script>
This is fine except for the fact that you can still see the outline of the nested container. Is there a work around to make the entire container invisible?
Cheers,
Neil
jbonifaci
I don't believe so, unless something was changed in 6.5+, you can not hide containers.