Access DCT Tabs elements using FormAPI

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);

Advertisements

One thought on “Access DCT Tabs elements using FormAPI

  1. I want to set the values from one datatype’s (DATATYPE1) dcr to other datatype’s dcr (DATATYPE2). Also want the DATATYPE2 dcr to open in a new window.

    I got the handle of the second DATATYPE2 dcr by using the following code.

    Var targetHandle = window.open (temp); where temp- URL of DATATYPE2 dcr

    How can I access the DATATYPE2 dcr’s formapi object for setting the value?

    Once I get access to that object I can proceed doing…..api.IWDatacapture.getItem (XXX).setValue (YY);

    I need ur help for this problem..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s