Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
FormAPI: finding the parent of a DCT item
System
In TS6.5 FormAPI, from a DCT item, IWItem, I don't see a method provided to get to its parent item or its siblings. What if I a replicant container, each instance of the replicant has a number of children. IF the first child is a cgi-callout button, if I click on this button it would clear out all the values of its siblings? I was trying to write a onCallout event handler. But I can't find a way to know exactly which replicant instance it is when the callout even occurs.
In datacapture.cfg, I have:
<container name="parent" location="parent" combination="and" min="0" max="5" default="0">
<item name="child1" pathid="child1">
<hidden>
<cgi-callout label="Clear"/>
</hidden>
</item>
<item name="child2" pathid="child2">
<text size="40" />
</item>
..
<item name="childn" pathid="childn">
<text size="40" />
</item>
</container>
The goal is to clear out values of child2 to childn when the Clear button (child1) is clicked, and it should only affect the current replicant instance.
Find more posts tagged with
Comments
Migrateduser
Although this is not 6.5 specific, you can always do something like: IWDatacapture.getItem(item + '../sibling') -- notice the "../". I'm not sure if this is officially supported but it sure works well!
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
Migrateduser
Dave, thanks a lot! It does work well.