I have a situation where we are using tabs within the DCT’s. Here is my sample structure of the DCT.
root-container combination=”and” name=”press” location=”press”>
tab name=”Presentation”>
container name=”header” label=”Header” location=”header” min=”0″ max=”3″ default=”0″>
item name=”h1″ pathid=”h1″ label=”Heading”>
database data-type=”VARCHAR(100)” />
text required=”t” maxlength=”100″ />
I do have other tabs within the DCT. Now the problem. I’m trying to set the visibility of item h1 using FormAPI. The script is shown below
IWDatacapture.getItem(“/press/Presentation/header/h1″).setVisible(true);
When I try to access this item, it throws
“IWDatacapture.getItem(“/press/Heading/head/h1″) has no properties”
When I remove the container and try to access this item h1, it works fine.
Solution:
Reference the container number
Old Code
IWDatacapture.getItem(“/press/Presentation/header/h1″).setVisible(true);
Modified Code
IWDatacapture.getItem(“/press/Presentation/header[1]/h1″).setVisible(true);