Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
does setVisible work with replicants & containers?
obradoa
I have been unable to hide replicants or containers by using functions from FormAPI. It works for regular items, but as soon as I use containers or replicants, the function does not work. How can I hide replicants and containers by using FormAPI?
Thanks!
Replicant that I am trying to hide:
<item name="TestItem" pathid="TestItem">
<replicant name="repTestItem" pathid="repTestItem" min="0" max="50" >
<item name="Test_Link_Name" pathid="Test_Link_Name">
<label>Test Link Name</label>
<text size="30" maxlength="100"/>
</item>
</replicant>
</item>
Function from FormsAPI documentation:
function setItemStatus(item,status){
item.setVisible(status);
item.setRequired(status);
//If we're hiding this item and making it optional,clear
//its value.This prevents irrelevant data from being saved
//in the DCR,and avoids validation errors in hidden fields.
if (!status){
item.setValue("");
}
}
I am calling this function like this:
setItemStatus (IWDatacapture.getItem("/Description"),false); //works for a regular item that is not replicant
setItemStatus (IWDatacapture.getItem("/TestItem"),false); //does not work for replicants
Thanks!
Find more posts tagged with
Comments
Adam Stoller
I believe you can only hide containers - not replicants (I believe there's a bug/feature request on this but don't recall what it is ... though in 6.x you don't need replicants as containers and items can do the replicating themselves)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Bjorn
Do you know if you can can set containers to readonly?
iwovGraduate
Hey heres an idea - look at the DTD.
Bjorn
Or better yet, RTFM.
The readonly in form API has nothing to do with the element of the same name in DCTs. But after reading the friendy manual, I learned that you cannot set containers to read only in FormAPI. Oh well.
iwovGraduate
Atleast somebody finds the manual to be
friendly