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)
replicants and formapi
nipper
I have a replicant of the folloing container:
Text
islink Radio (Y/N)
URL
so if the radio is Y then URL is visible otherwise not.
my problem is that if I have 2 replicants, and add a 3rd in the middle,
then the last replicant does not work anymore.
DCT attached
Tips/Pointers/RTFMs appreciated
Andy
Find more posts tagged with
Comments
Adam Stoller
Just looking at the code - I have a few comments - which may, or may not, lead to your solution:
Why are you looping through all /Data elements at startup attaching event handlers to them - you should just put the onChange event handler within the
init
function
In
initialize
you are re-defining the variable
item
from being an IWitem to being a string - while this might work, it's probably not a good practice
You're doing the same thing in
checkvis
with respect to redefining
item
My guess would be that the real problem is the first one listed.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Yes, ghoti is right. try with the following code in your form api.
function init(){
IWEventRegistry.addItemHandler("itemname","onItemChange",handle_change);
}
Thanks
RG
nipper
Cool, that make a great deal of sense. I though I needed to add the
event handler to each instance.
I will try it, thanks.
nipper
Thanks Ghoti and R_j
yes, when I changed the event handler definition, it works. I knew it was something
stupid. Good point also about the redefine of item, I will use a second variable.