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

How to bind dynamic row data to submit it by HTTP submit (PHP) - change names Row[1] and Row1 - addInstance and Data Binding

bartosh44
Registered: Dec 18 2010
Posts: 8

Hi,
i have got another problem.
 
I have got table with dynamic add/remove Table Row button. When i add it their names are Table.Row[0] , Table.Row[1], Table.Row[2] etc. Only Table.Row is real, and every other row is create dynamically by addInstance script command.
 
When i fill "Data Binding" box like this: "Use name(Row)" then after submiting it do PHP i will see only last Table.Row data. For example if last would be Table.Row[3] then i will see only this on my submit.php and the others will be replaced this value. This is happen becouse of replacing value by value with the same name (data binding is see only one Table.Row without:"[1]", "[2]", "[3]" etc.).
 
I guess that if i would change something to get addInstance command with Row names like Row1, Row2, Row3 then all will be ok.
 
Another way it`s to change something in the "Data Binding" box (Object > Binding Tab) to get relative name like Row[*] instead of "Use name(Row)".
 
I heard also that way with XML Schema but i would like to find easiest way to do it.
 
Anybody would help me? I will be grateful :)

My Product Information:
LiveCycle Designer, Windows
DaveyB
Registered: Dec 10 2010
Posts: 70
Since you are sending the form data to PHP, have you considered converting the table section of the form to an array? PHP can handle an array quite easily, whereas multiple lines of data, each with the same field names, just confuse the issue!

Hope that helps!

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

bartosh44
Registered: Dec 18 2010
Posts: 8
Thanks for quick reply.

How to change all table to one array? Is there any simple tip for that?

i have done it by doing XML schema and then binding all fields with that schema. Then i used save XML to string and i used submit button. If i used only submit button without saving XML to binding variable, i`ve got only last row present.

DaveyB
Registered: Dec 10 2010
Posts: 70
Sorry for the delay, but I think I found an answer for you while I was looking for something related:

Take a look at expandable table with totals and scroll down to the comments. Look for the interchanges between Stefan and Ash, starting at around post # 34, see if that gives you any leads.Another thought on the same subject; could you iterate through each row and send the datasets separately? Look at the script sample on that same page immediately above the heading "Sample Form with Row Remove Button". It iterates through each row summing the totals fields - same concept, but sending the row to the server instead? Just an idea :)

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

mandy12
Registered: Mar 10 2011
Posts: 2
I have the same issue I am new to Livecycle forms only the last row data is coming back to the ,I have bond the table to an java array and that is connected to the web service. My web service takes in a array , It gets the data only for last row. Have any of you resolved this issue...All your help is greatly appreciated


thomp
Expert
Registered: Feb 15 2006
Posts: 4411
When a repeated subform is used in a dynamic forms, it has to be bound to the data model in a certain way. If you do not connect the form to a data source, then the default binding is setup correctly when you create the table and set it up for dynamic operation. But if you do connect the form to a data source, then the data model is modified to take on the structure of the data source and it is your responsibility to make sure fields in the form are correctly bound to the data model.

For example, a repeated row in a table should be bound to a repeating node in the data model. Say the repeated node is called "OrderLine", then "Row1" would be bound to "OrderLine[*]", meaning that it is connected to all of the repeated nodes, not just one of them.

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

mandy12
Registered: Mar 10 2011
Posts: 2
I have done that the table Row is bound to two datasources one in the input in my case it is return[*]
and to another to post data to web service which is entityArr[*] which will be is a Java Array.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What do you mean the table row is bound to two data sources?

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