These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

dynymic table: automated numbering (increment) in cell

mading
Registered: Jun 12 2008
Posts: 20

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

My Product Information:
LiveCycle Designer, Windows
StevenD
Registered: Oct 6 2006
Posts: 368
Making the index number of a table row or subform instance appear in a text field

//Use this in the calculate event of a text field in a table row or sub form. As new rows are added they will be auto numbered.

var myNum = table row or subform.index;
this.rawValue = myNum + 1;

//NOTE: You must also use the recalculate method when you are removing rows/sub forms so the number in the fields will readjust.

xfa.form.recalculate(1);

StevenD

mading
Registered: Jun 12 2008
Posts: 20
Hi,

unfortunately it doesn'T work. I opened the calculation event of the cell and pasted the code you provided but it didnt work :(

Where do I have to put the recalculation line?

Any suggestions?

THanks,

mading
jtaylor46
Registered: Jun 13 2008
Posts: 14
Mading, I put a auto number numeric field on a log in the calculate event for this field as because I wanted my auto number to begin with 101:

this.access = "protected";
this.rawValue = this.parent.index +101;

On my add/del buttons I used the followng code. Of course the remove would be substituted for the del button

P1.Info.instanceManager.addInstance(1);
xfa.form.recalculate(1);


Hope this helps!