I'm stuck on this and would really appreciate any help or advice anyone has.
I've got a set of repeating tables and I'd like to show the index number for the current one. The structure is like this:
- Values [subform]
- costObjectKey [text field]
I want to show the index in the costObjectKey text field, so in the initialize event I've added the following script:
xfa.host.messageBox( this.resolveNode("$.parent.parent.parent").name + "[" + this.resolveNode("$.parent.parent.parent").index + "]" );
this.rawValue = this.resolveNode("$.parent.parent.parent").name + "[" + this.resolveNode("$.parent.parent.parent").index + "]";
The message box shows 0 then 1 (which is what I'd expect), but the text field shows 1 both times.
I've also tried:
- putting the script in the calculate event
- using this.parent.parent.parent.parent._Values.count;
but I always just see 1. What am I doing wrong?!
Many thanks in advance,
We won't be able to know unless we see the structure of the form as well as knowing which subform is repeating. Can you post an image of the hierarchy in that area and indicate which subform is repeating?
I got it sorted, school boy error on my part: had the field marked as global as I wanted to use the values in another place on the form, but I just repeated the logic in the second place.
Next time I'll post up screen grabs.