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)
Form API and replicants
rijagu
I have a DCT containing
<container name="Contacts - Direct Sales">
<item name="Marketing Contacts">
<replicant default="0" min="0" required="f" max="100">
<item name="Marketing Contact Name">
<description>
Enter Marketing Contact Name
</description>
<label> Name</label>
<text maxlength="100" required="f" size="50"/>
</item>
<item name="Marketing Contact Title">
<description>
Enter Marketing Contact Title
</description>
<label>Title</label>
<text maxlength="100" required="f" size="20"/>
</item>
<item name="Marketing Contact Area of Responsibility">
<description>
Marketing Contact Area of Responsibility
</description>
<label>Area of Responsibility</label>
<text maxlength="100" required="f" size="50"/>
</item>
<item name="Marketing Contact Phone Number">
<description>
Marketing Contact Phone Number
</description>
<label>Phone Number</label>
<text maxlength="50" required="f" size="10"/>
</item>
<item name="Marketing Contact Email">
<description>
Marketing Contact Email
</description>
<label>Email</label>
<text maxlength="100" required="f" size="50"/>
</item>
<item name="Marketing Contact Address">
<description>
Marketing Contact Address
</description>
<label>Marketing Contact Address</label>
<textarea cols="60" rows="5" required="f" wrap="virtual"></textarea>
</item>
</replicant>
</item>
</container>
Now i want to hide the replicant.
Can i use
var marketing_contacts_item = IWDatacapture.getItem("/Contacts - Direct Sales/Marketing Contacts[1]");
marketing_contacts_item.setVisibl(false);
to hide the replicant? It does not work though.
Thanks
Ravi
Find more posts tagged with
Comments
Migrateduser
Are you calling redraw after setvisible? I think that may be required. I have never hidden a replicant though.
rijagu
Yes, I am calling redraw too. Doesn't seem to work.
Migrateduser
I had a similar problem but I have now managed to get it to work. I'll try and explain, hopefully it might be some help:
Firstly all of my items names contain no spaces as I recalled this giving me some problems: your container could be called "ContactsDirectSales" and then you could use a label to set the name back to "Contacts - Direct Sales"
Secondly do you want to hide just the second replicant or a singular item across all replicants?. I'll assume you you want to hide the second replicant. (0=1st rep, 1=2nd rep...)
I think it might be best if you set each individual item to be visible(false) as this definitely works. So if this is the only item, it would be something like:
IWDatacapture.getItem("/Contacts - Direct Sales/Marketing Contacts/Marketing Contact Name[1]").setVisible(false);
Then repeated for each item. If this was not to work then try getting an array of the root items and then getting the children of them, then setting them to visible(false)
rootItems = IWDatacapture.getRootItems();
array = rootItems[0].getChildren();//to get the children items
until you have the correct items and then hide them, then redraw the form. Use alert(array); to let you know where you are.
Good Luck!
Edited by DanMint on 02/21/03 01:05 AM (server time).