Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
TeamSite
TeamSite, LiveSite and OpenDeploy
TS 6.7.1 FormAPI setVisible() problem
System
In TS6.7.1 FormsPublisher, if my custom script set an item within a replicant container invisible using setVisible() when the replicant is first added, then I'm not able to make this item visible again. The same code worked fine in TS 6.5. It looks like a bug to me. Here is the javascript. Also see the datacapture.cfg in attachment. I notice that if I put setChildStatus(contactItem, true); instead of setChildStatus(contactItem, false); in addOneHandler(), then the show and hide button works fine. However, we need to hide the detail field first.
function init() {
IWEventRegistry.addItemHandler("/contacts/show_button",
"onCallout", showDetail);
IWEventRegistry.addItemHandler("/contacts/hide_button",
"onCallout", hideDetail);
IWEventRegistry.addItemHandler("/contacts/individual_contact",
"onReplicantAdded", addOneHandler);
hideDetail();
}
function showDetail(item) {
var i = 1;
var contactItem;
while (contactItem = IWDatacapture.getItem("/contacts/individual_contact[" + i + "]")) {
setChildStatus(contactItem, true);
i++;
}
}
function hideDetail(item) {
var i = 1;
var contactItem;
while (contactItem = IWDatacapture.getItem("/contacts/individual_contact[" + i + "]")) {
setChildStatus(contactItem, false);
i++;
}
}
function addOneHandler(contactItem) {
setChildStatus(contactItem, false);
}
function setChildStatus(item, status) {
var child = item.getChildByName("contact_detail");
child.setVisible(status);
}
// Call the initialization routine on load.
IWEventRegistry.addFormHandler("onFormInit", init);
Find more posts tagged with
Comments
There are no comments yet