on 02-18-2009 11:50 AM
Hi all,
I hava a table and when I create a new record I have to read the previous one for some check.
Which is the script to read a particular record in a table?
THANKS
ENZO
This is one of the many ways :
var dataline = xfa.form.data.PAGE.SUBFORM.TABLENAME.resolveNodes("DataRow[*]");
This puts all the nodes of a table into the dataline variable.
You can then use this code to loop through the table and access the field TEXTFIELD in that row :
for ( i = 0; i < dataline.length; i++ )
{
dataline.item(i).resolveNode("TEXTFIELD").rawValue;
}
You can use the resolveNode function to capture specific fields in a structure as well, using dots :
dataline.item(i).resolveNode("SUBTABLE.ROW2.TEXTFIELD").rawValue;
If you want to catch the last line, use :
dataline.item(dataline.length).resolveNode("TEXTFIELD").rawValue;
If you want to catch the second to last line, which I presume is what you want use :
dataline.item(dataline.length - 1).resolveNode("TEXTFIELD").rawValue;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.