Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Hiding a Container on Page Two
cvel2
Hi everyone -
I've looked all around the posts on Dev Net and have not seen anyone come across this issue yet, but hopefully someone has seen it and has a work around. I'm on a Windows 2000 server running TeamSite 6.1.
In my DCT I have two pages. On the second page I have multiple containers, we'll call them container A, container B, and container C. In containter A there is a radio button item with two choices. Based on the users choice of radio button options, either container B or container C will appear/be hidden. The on item change event works, but both of the containers are displayed on init when one of them should be hidden. The interesting thing is, when I move the containers to the first page, the code works. I did make sure that I am using the on form init item handler which I have seen as a resolution to a similar problem, but this didn't fix the problem.
Any one have any ideas?
Christina
Find more posts tagged with
Comments
cvel2
I posted this a while ago with no response - I'm assuming no one has encountered a similar problem? My next question is, has anyone experienced
any
strange behavior with hiding containers in mulit-page DCTs?
Christina
Migrateduser
You've explained the Container A/B/C thing well, but could you post your code? I'd like to help, but it's still a bit abstract.
Dave
Current Environment(s):
(1) TS 6.1 SP2 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 6.1 SP2 on Win2K
cvel2
Hi Dave,
Thanks for your offer to help. Here is the DCT and the JS (I am only including what is important). What you'll notice if you run this, when the DCT is loaded and you go to the second page, both of the containers on the second page appear, when the styleHide() function should have hidden one of them. If you select the other radio button, the correct container disappears. Then, if you go back to the first page, and return to the second page, both of the options appear again. It is as if the hidden elements are not remembered when toggling between pages. Any advice you can give would be much appreciated.
/////////////////////////////////////////////////////////////DATACAPTURE//////////////////////////////////////////////////////
<?xml version="1.0" standalone="no"?>
<!DOCTYPE data-capture-requirements SYSTEM "datacapture6.0.dtd">
<data-capture-requirements>
<ruleset name="Login">
<label>CCC Login Page</label>
<script src="Login.js" location="template-type"/>
<root-container location="Root" name="Root">
<label/>
<container name="Metadata" location="Metadata">
<label>MetaData</label>
<item name="Filename" rowcontinue="t" pathid="Filename">
<label>File Name</label>
<description>The "Link Parameter" or the "link URL string" or the Name of the "Includes" file.</description>
<text required="t" size="20" />
</item>
</container>
<container name="Login" location="Login">
<label>Login Information</label>
<container name="Header" location="Header">
<label>Header Selection</label>
<item name="Selection" pathid="Selection">
<label></label>
<description></description>
<radio>
<option value="image" label="Image" />
<option selected="t" value="text" label="Text" />
</radio>
</item>
</container>
<container name="TextSelection" location="TextSelection">
<label>Header Selection - Text</label>
<item name="Text" pathid="Text">
<label>Text:</label>
<description>Launch Visual Format and type the paragraph text.</description>
<text size="55"/>
</item>
</container>
<container name="ImageSelection" location="ImageSelection">
<label>Header Selection - Image</label>
<item name="Image" pathid="Image">
<label>Image:</label>
<description>Browse to select an image from TeamSite or Upload an image from your local computer.</description>
<browser extns=".gif,.jpg" size="42" initial-dir="/content/Login/images" ceiling-dir="/content/Login/images">
<cgi-callout url="/iw/blank.html" label="Upload Image" window-features="width=600,height=200,resizable=yes,toolbar=no,scrollbars=yes"/>
</browser>
</item>
<item name="ImageAltText" pathid="ImageAltText">
<label>Image Alt. Text:</label>
<description>Enter the text you would like to have appear when a user hovers the mousepointer over the image.</description>
<text size="55"/>
</item>
<item name="ImageURL" pathid="ImageURL">
<label>Image URL:</label>
<description>Enter an image URL</description>
<text size="42"/>
</item>
</container>
</container>
</root-container>
</ruleset>
</data-capture-requirements>
/////////////////////////////////////////////////////////////JAVASCRIPT//////////////////////////////////////////////////////
init();
function init()
{
IWEventRegistry.addItemHandler("/Root/Login/Header/Selection", "onItemChange", styleHide);
styleHide();
}
//////////////////////////////////////////////////////////////////////
// Function: styleHide
// Description: Function called on form initialization and on the
// header style on change event. This function shows or
// hides the text or image selection items based on the
// choice made in the selection item.
// Parameters:
// None
// Return value:
// None
//////////////////////////////////////////////////////////////////////
function styleHide()
{
var textContainer = IWDatacapture.getItem("/Root/Login/TextSelection");
var imageContainer = IWDatacapture.getItem("/Root/Login/ImageSelection");
textContainer.setVisible(false);
imageContainer.setVisible(false);
var style = IWDatacapture.getItem("/Root/Login/Header/Selection").getValue();
switch(style)
{
case 0:
imageContainer.setVisible(true);
break;
case 1:
textContainer.setVisible(true);
break;
}
IWDatacapture.redraw();
}
Christina
KTReddy
Hi Christina,
Any Luck on this issue. We are also facing same problem and i could't find exact solution for this on devnet.
I would appreciate, if anyone can help me to solve this issue.
Thanks,
KT