Hello,
I use checkboxes to add new data/lines into my table.
Everything seems to work fine. My table is correctly filled but the xml data on preSubmit is totaly wrong.
You can also check it in my sample file.
My code:
functionaddNewLine(CheckBox){
var counter;
if (CheckBox.rawValue ==
"X"){// add new line
xfa.form.data.page2.MyTable._MyTable_Data.addInstance(true);
// get last line
counter = xfa.form.data.page2.MyTable._MyTable_Data.count - 1;
// insert data into the last linexfa.resolveNode("xfa.form.data.page2.MyTable.MyTable_Data[" + counter + "]").LineOne.COUNTERONE.rawValue = counter;
xfa.resolveNode("xfa.form.data.page2.MyTable.MyTable_Data[" + counter + "]").LineTwo.COUNTERTWO.rawValue = counter;
}
}
Table filled - CORRECT
XML-Output / Attachment - WRONG!!!
<?xml version="1.0" encoding="UTF-8" ?>
<COUNTERONE>1</COUNTERONE><INPUTONE /><COUNTERTWO /><INPUTTWO /><COUNTERTHREE /><INPUTTHREE /><COUNTERFOUR /><INPUTFOUR /><COUNTERFIVE /><INPUTFIVE /></DATA>
<COUNTERONE>2</COUNTERONE><INPUTONE /><COUNTERTWO>1</COUNTERTWO><INPUTTWO /><COUNTERTHREE>1</COUNTERTHREE><INPUTTHREE /><COUNTERFOUR>1</COUNTERFOUR><INPUTFOUR /><COUNTERFIVE>1</COUNTERFIVE><INPUTFIVE /></DATA>
<COUNTERONE>3</COUNTERONE><INPUTONE /><COUNTERTWO>2</COUNTERTWO><INPUTTWO /><COUNTERTHREE>2</COUNTERTHREE><INPUTTHREE /><COUNTERFOUR>2</COUNTERFOUR><INPUTFOUR /><COUNTERFIVE>2</COUNTERFIVE><INPUTFIVE /></DATA>
<COUNTERONE /><INPUTONE /><COUNTERTWO>3</COUNTERTWO><INPUTTWO /><COUNTERTHREE>3</COUNTERTHREE><INPUTTHREE /><COUNTERFOUR>3</COUNTERFOUR><INPUTFOUR /><COUNTERFIVE>3</COUNTERFIVE><INPUTFIVE /></DATA>
</MYTABLE>
</data>
can anyone help me to resolve this problem, please?
#
files:
Views
Replies
Total Likes
Here is the corrected file..
https://acrobat.com/#d=x*HgItYmjMg8ElMH6uZaUA
You do not need a section..
And then I bound your table to the repeating tag in your XML.
Thanks
Srini
Views
Replies
Total Likes
Hello, thank you for the fast answer.
Unfortunally your uploaded file still has the problem with "wrong" xml-output IF I DO NOT USE the "input-xml". Do you have any other idea how to fix it?
Compare PDF-Data and XML-Data: (red = wrong index / counter)
Views
Replies
Total Likes
hello again, experts
I still hope anyone could explain the strange behavior of the instance manager.
if you use my form or the one, posted by Srini, you will see, that the first data-row of the table always gets the value of the following row at its first attribute. (watch picture).
It does not matter if the table has "min 1 row" or not. How could I fix that, would anyone please explain? After all the following row-entries are placed "correctly", so it seems until I click on send and get the messed up xml-output ; (
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies