Expand my Community achievements bar.

SOLVED

How to get the current row index of a subform?

Avatar

Level 1

Hello Adobe experts,

first of all I have to apologize beforehand, if I don't provide all the necessary information of my problem. It's my first question here...

I'm using the livecycle designer in combination with SAP to create print forms, so I have to deal with most of the provided XML data. My problem is the following:

In our invoice form we have a subform "position" which contains another subform "data" which is repeated by the number of positions we have in our invoice. So if a customer bought three items, the subform "data" gets also repeated three times. To display certain kind of

pricing information, I really need to know the row index of the subform.

For example:

Row index 1 --> Item No. 9876, 14$

Row index 2 --> Item No. 9871, 10$

Row index 3 --> Item No. 9870, 12$

I already tried POSITION.DATA.instanceManager.count in the calculate event of a field in the subform, but it only returns 3, the absolute number of rows.

I'm sure, there is an easy solution, but I really didn't find anything so far.

Thanks in advance

André

1 Accepted Solution

Avatar

Correct answer by
Level 10

all you need to do... in the event of an object inside your row --> subform, use the reference_syntax to use the row you are in

you can also use the parent statement to go back to the row root you want to know the instance

if you have TextBoxes inside subforms inside the row... use :

this.parent.parent.index;

if you have TextBoxes inside the row... use:

this.parent.index;

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

all you need to do... in the event of an object inside your row --> subform, use the reference_syntax to use the row you are in

you can also use the parent statement to go back to the row root you want to know the instance

if you have TextBoxes inside subforms inside the row... use :

this.parent.parent.index;

if you have TextBoxes inside the row... use:

this.parent.index;

Avatar

Level 1

Thanks Robert, this really did it! Now I can use it to display my material prices!

Greetings from Germany

André

Avatar

Level 1

this.parent.parent.index worked for me