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)
Bug TS 6.7.1 OnReplicantAdded and setVisible
Rob76
There seems to be a bug with the OnReplicantAdded event and the setVisible method in TS 6.7.1 on Windows 2003 SP1. This code worked in TS 6.5 SP2.
We have a radio button in a form that hides and unhides another item. There is an onItemChange event that does this as well as an OnReplicantAdded event. The onItemChange event seems to work fine when the replicant item exists, but when a new replicant item is added, the setVisible method does not display the hidden item.
One curious thing, and we've been using this as a workaround, is if you click "Collapse All Items" and then click "Expand All Items" the hidden item that didn't show up before, shows up when expected. In addition, if we set the replicant-render item in templating.cfg to "collapsed" the hidden item never shows up.
Below is our FormAPI code as well as the datacapture.cfg from the root element
FormAPI
IWEventRegistry.addFormHandler("onFormInit", init);
function init()
{
IWEventRegistry.addItemHandler("/Root/Level1/IncludeOnBranch", "onItemChange", toggleBranchItems);
IWEventRegistry.addItemHandler("/Root/Level1", "OnReplicantAdded", toggleBranchItems);
toggleBranchItemsOnEdit(IWDatacapture.getItem("/Root/Level1"));
}
function toggleBranchItems(item)
{
var Xpath = item.getName();
if (Xpath.match("IncludeOnBranch"))
{
var IncludeOnBranchValue = _getSelectValue(item);
}
else
{
var Xpath = Xpath + "/IncludeOnBranch";
var IncludeOnBranchValue = _getSelectValue(IWDatacapture.getItem(Xpath));
}
var BranchListXpath = Xpath + "/../BranchList";
if (IncludeOnBranchValue == "default")
{
IWDatacapture.getItem(BranchListXpath).setVisible(false);
}
else
{
IWDatacapture.getItem(BranchListXpath).setVisible(true);
}
}
function toggleBranchItemsOnEdit(item)
{
var Level1Children = item.getChildren();
if (Level1Children == null) { return; }
for (var i = 0; i < Level1Children.length; i++)
{
var x = i + 1;
var Xpath = item.getName();
var Xpath = Xpath + "[" + x + "]/IncludeOnBranch";
toggleBranchItems(IWDatacapture.getItem(Xpath));
}
}
Datacapture.cfg
Primary Link
Primary Link
Link Text
Type the text for this link (TeamSite Administrators and above)
Link
Select the link
Include on branch
Checking "Custom" allows you to add this navigation item to another branch
Include branch
Check branches in which this navigation item should appear
Find more posts tagged with
Comments
There are no comments yet