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)
How to Retrieve the value of item in replicants
LIWoven
Hi All,
I am new to Teamsite and i have created one Form which has nested containers like
container name="discipline" combination="and" min="1" max="499"
item name="disc_code" pathid="disc_code"
container name="coursecode" combination="and" min="1" max="499"
item name="course" pathid="coursecode"
container name="subheader" combination="and" min="0" max="499"
item name="subheader_name" pathid="subheader_name"
container name="title" combination="and" min="1" max="499"
item name="ISBN" pathid="ISBN"
item name="copyrightyear" pathid="copyrightyear"
There are two problems
1) I am not able to retrieve the value of ISBN item onSave event using
IWDatacapture.getItem("disciplines/discipline/coursecode/subheader/title/isbn").getValue();
I am able to retrieve its value using onItemChange event but not using IWDatacapture.getItem in save event.
2) As discipline container can get replicated i want to validate onSave that two discipline Item do not have same disc_code,that means every discipline disc_code should be unique.
I am using xml format output generation.
I am not able to find a way to solve them Please guide me if anyone knows how to do that.
Thanks
Monika
Find more posts tagged with
Comments
Adam Stoller
Please spend some quality time reading the FormsPublisher and FormAPI Developer's Guides - especially the latter in this case.
When dealing with a replicated item - you need to provide the address (xpath, path, name, whatever you want to call it) to a particular index of the list of items within the replicated instance. This works for event handler functions because the event handler takes care of sending the address of the specific instance of the item which caused the trigger to be activated. You could do it with getItem() if you wanted to - but usually (in the case of replicants) it would be done within a loop formed by getChildren -- which you might want to search for in the forums, as there's been a fair amount of posts (some with code) on that topic.
KelvinYong
I recently did something like this, crawling through layers/depth of the objects to find the right one.
Definitely read the FormAPI Dev Guide, it's in there, though not very easy to understand first time but with lots of trial and error and hunting down the right element, you'll get there. Good to fully understand JavaScript to help with objects and functions.
LIWoven
I found one example that retrieve object usiing xpath and getChildern and now i am able to do that
Thanks all for valuable information.