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)
Hiding Replicant with FormAPI
phbillard
Hi
I my DCT I have a replicant defined as follow (it gathers DCR from another data-type) :
<item name="Picklist">
<replicant min="1" max="15">
<item name="CTX_Origine">
<database deploy-column="f"/>
<select required="f">
<inline command="/IW/iw-home/iw-perl/bin/iwperl /IW/iw-home/local/config/b2c_dev/inline/af_push.ipl promotions/originePromo CTX_Titre" />
</select>
</item>
</replicant>
</item>
This DCT as others fields that I hide/show depending on checkbox selection. My problem is that I can't hide the replicant (/Picklist) neither its item (/Picklist/CTX_Origine) with the FormAPI. I tried other methods (setVisible, setRequired ...), none is working on either item of my replicant.
Any solution ?
TS 5.5.2 SP2, TST 5.5.2 SP2 on Solaris
Philippe BILLARD
Interwoven product admin
Air France
Find more posts tagged with
Comments
jamesk
you beat me to it. ive also been trying to solve this one.
For some reason you cant change the visability of it in the same way as a normal item or container.
anyone got any ideas?
Smeeta
In order to hide a replicant item you need to specify the index of the replicant item that you want to hide. In other words if Picklist is the name of the replicant item and ID is the name of the item within it then the following code will work to hide the first replicant instance.
Picklist[1]/Id.setVisible(true);
So to hide all instances id within a replicant item you need to loop through all the replicant children.
You can do that with the following code:
var SpecTypes = new Array();
var SpecificationItem = IWDatacapture.getItem("/ProdSpecValues/Specification");
SpecTypes = SpecificationItem.getChildren();
In the above code ProdSpecValues is the name of the container and Specification is the name of the replicant item.
You then need to loop through these children and hide each instance of the replicant item.
for(j=0;i<SpecReplicantItems.length;j++)
{
var childItem = SpecReplicantItems;
var itemName = childItem.getName(); //Returns the XPath of the item as a string
var SpecIdItem = IWDatacapture.getItem(itemName + "/Id");
SpecIdItem.setVisible(false);
}
Hope this helps
Edited by Smeeta on 01/23/03 06:58 AM (server time).
jamesk
wow - thanks for all the formapi answers really helpful.
this is just what i was looking for.
james