on 02-25-2010 12:02 AM
Hi All,
I want to read the content of a table row.
I tried the dynamic approach:
var x = xfa.resolveNode("mainpage.table.row\["\+i\+"\].field1").rawValue;
I got some value but that is not the value stored in the table. It is very weird. Please let me know what mistake I am doing.
even I tried the static way:
var x = xfa.resolveNode("mainpage.table.row[2].field1").rawValue;
In this case also I got a value which is not stored in the table. but the value in both the cases are same.
Another question:
Can't I use the following statement to get the static row field value.
var x = mainpage.table.row[1].field1.rawValue;
Appreciate your help.
Thanks,
Chandra Indukuri
Hello,
you should start reading here:
maybe it will make you happy that the last chapter is about the ready-to-use examples/ typical problems and their solution.
Hope this will solve this and many other future problems of yours,
regards, Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Simple mistake.
Shouldn't use x as a variable. Because 'x' is a script property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should be
var x = mainpage.table.row1.field1.rawValue; // First row, Assuming field1 is name of field you are using.
The code to read Table through JavaScript has been discussed here at SCN. You may Search for it and check your code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandra
Below is an example of calculating a total (from the LCD ES Scripting Reference).
var oFields = xfa.resolveNodes("Subform2[*].NumericField4");
var nNodesLength = oFields.length;
var nSum = 0;
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
{
nSum += oFields.item(nNodeCount).rawValue;
}
TextField1.rawValue = nSum;
As you can see, the first line resolves all the nodes that exist for Subform2. It then loops through them individually.
Perhaps try to adapt the code above to suit your suborms and tables/fields.
Kind regards,
Casper
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.