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

How to get a Last Row of aTable

Pramod_10
Registered: Dec 7 2011
Posts: 2

I have a table with some rows of data,I need the last row data.
How to acheive this using script or adobe life cycle designer.
 
Appreciate for the answers.
Thanks in advance.
 
Best Regards,
Pramod

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Each instance of a row is referenced with an index. In JavaScript the resolveNode() function uses a SOM expression to locate the specific subform that represents the row.

You'll find specifics in this video:
Extending LiveCycle Forms

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Pramod_10
Registered: Dec 7 2011
Posts: 2
Hi Thomp

Could you please give me a code snippet,that will be so useful.

Thanks in advance.

Best Regards,
Pramod

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok, a SOM path is built from the hierarchy of elements in the form. So if "Table1" is the name of the table and "Row2" is the name of the repeated Row within that table. Then a script could use this code to get the subform object for the last "Row2"

var oTable = xfa.form.form1.pg1.Table1;
var oLastRow2 = oTable.resolveNode("Row2[" + (oTable._oRow2.count-1) + "]");

But believe me, watching the video will really clue you in, and save you a great deal of time. Also read the "Debug" article linked in my signature block below.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script