on 05-11-2010 5:45 PM
Hi everyone.
I'm unable to solve the following problem:
In an offline scenario I have a table which contains one line at creation time. The form offers a button to add lines to the table using javascript and the instanceManager of the table.
If the added lines are beeing filled by the user I can extract that data without a problem.
But I cannot acces the newly generated fields with java script.
I'm not sure, what the problem is. Here is the code, which should do the job:
xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]").rawValue = 'Andreas';
This works fine, for the table line, that exists right from the beginning(position = 0), but not for any added line.
I keep getting this error: xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]") has no properties
What am I doing wrong?
Thanks for any hints,
Andreas.
I think in your case you are getting that message because the new line hasn't been added successfully.
After adding the instance(row) to the table use: xfa.form.recalculate(1);
If it doesn't solve your problem then please let us know the Java script code you wrote to add the new line.
Thanks,
Chandra Indukuri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not sure if that will help you in any way, but if you don´t need to access the rows in some special way, you could benefit from the indirect/ relative adressing. If you want to manipulate the row based on the data in that row, why don´t you use "this" pointer and place the script on the subform of the row? I understand that doesn´t help for all cases, but could help in few.
Regards Otto
Solved the problem now and it was fairly easy looking at it now.
I don't know, why the above mentioned adressing does not work, but it works like this:
var tab = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]");
// get the last position
var last = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]").length - 1;
// fill values
tab.item(last).NAME1.rawValue = "Andreas";
Edited by: Andreas Heckele on May 17, 2010 11:07 AM
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.