cancel
Showing results for 
Search instead for 
Did you mean: 

dynymic table: automated numbering (increment) in cell

Former Member
0 Kudos

Hi,

I've created a dynamic table (with add/ remove buttons) in which one column should have an incremented number which should be automatically added. So if I click on the add-button, I'd like to have each row numbered with an incremented value. Anyone can tell me how to do this?

thanks,

mading

Accepted Solutions (0)

Answers (1)

Answers (1)

harman_shahi
Contributor
0 Kudos

Hi Martin

1) Place a TextField in the Column where you would like to see the incremental value.

2) Place the following code in the Calculate Event of this TextField. (remember to set your language to JavaScript)

this.parent.index;

hope this helps,

harman

Former Member
0 Kudos

Hi Harman,

thank you for your answer (6pts rewarded). It works but I will have to click on the add button of each new row instead of clicking on the topmost add button. If I keep on clicking on the topmost add button, the numbering is like this:

No. 0 <-- I keep on clicking on the add button in this row

No. 6

No. 1

No. 2

No. 3

No. 4

No. 5

Thanks,

Martin

harman_shahi
Contributor
0 Kudos

Hi Martin,

It really shouldnu2019t matter where you place the button to add a row to the table; the incremental code is u2018relativeu2019 to tableu2019s index. Take the link below for example, you can move the u2018+u2019 button inside your table column, and the incremental still works fine. Please compare with your formu2019s settings with this link below:

http://www.adobe.com/devnet/livecycle/articles/AddingRemovingTableRows.pdf

Hope this helps,

Harman