Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Access DCT Tabs elements using FormAPI
pdasarat
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. Kindly let me know if anyone knows how to access this element or is this a restriction when using "tab" element.
-Pradeep
Find more posts tagged with
Comments
pdasarat
Ok got the solution. I have to 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);
-Pradeep
Arabind
Hi Pradeep,
I am a new user of teamsite, having lots of silly doubts.Plz correct me if I am wrong in my code.
situation where I am 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" />
/item>
/container>
/tab>
tab name="Availability">
container name="footer" label="Footer" location="footer" min="0" max="3" default="0">
item name="h1" pathid="h1" label="Footing">
database data-type="VARCHAR(100)" />
text required="t" maxlength="100" />
/item>
container>
/tab>
/root-container>
set the visibility of item h1 using FormAPI.
IWDatacapture.getItem("/press/Presentation/header[1]/h1").setVisible(true);
IWDatacapture.getItem("/press/Availability/footer[1]/h1").setVisible(true);
But when i m creating a new form entry then its showing tab cant appear at this level..So where I have made the mistake??
And how i'll retrive the values in the presentation file.
Thanking you in advance.
Adam Stoller
I'd recommend that you start coding your DCTs according to the datacapture6.0.dtd which should be done as "xml" style instead of "iwov" style and which does not (as far as I can tell) support "tab" (what version of TS are you using? What DTD are you looking at?)
pdasarat
As mentioned by ghoti, you need to check for the DTD and xml format.
Regarding accessing the tab fields within the presentation, the tabs will not appear in your end XML, so you need to reference the items as you do normally like "dcr.press.heading"
-Pradeep
Arabind
hi ghoti,
it is not like that bcoz of the dtd it was not working . But the prblem is That time i was working in TemSite 6.7.0. there fore it was not working.
Its working fine with dcr type "XML" & TeamSite 6.7.1.
cheers!!