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)
set visibility option for replicant items
hummingbird
I am trying to set some visibility option for a couple of replicant fields based on a selection field that is also within the replicant container. Here is my IWEventRegister statement
IWEventRegistry.addItemHandler("/Fund_Policies/Shared_Or_Fund", "onItemChange", SetVisible);
I also have a function called SetVisibleInitial to set up the initial visibility when the form loads.
This works fine for the first replicant section but stops working after the first one. Is there any way that the visibility option can be set when new replicants get created?
Find more posts tagged with
Comments
LooseCannon
I’ve yet to find a solution to this.
The onItemChange event only recognizes those replicant instances that exist at the time of registration.
cheeku
try out this code:
parent.IWDCEventRegistry.addListener( 'onItemAdded', handleItemAdded );
function handleItemAdded( item ) {
var xpath = getXPath( item );
if ( xpath.match( '^/Fund_Policies\\[\\d+\\]$' )) {
SetVisible();
}
}
function getXPath( item ) {
var xpath = null;
if ( typeof( item.getXPath ) != 'undefined' ) {
xpath = item.getXPath();
}
else {
xpath = item.getName();
}
return( xpath);
}