Highlighted

addInstance creating rows with fields bound together

Avatar

17-05-2008

I am using a data connection to prefill a dynamic form. The form has a AddRow button to allow adding additional blank rows beyond the prefilled rows. AddRow executes the following two lines as the click event:



root.PO.grid.Table1.#subformSet[0].action.AddRow::click: - (JavaScript, client)



Table1._r2.addInstance(1);



xfa.form.recalculate(1);



Some fields in the row r2″ have default bindings such as

b $record.item[*].OrderMult

and

b $record.item[*].ItemDesc1

, etc. which are used during prefill.



The strange behavior is that the

b ItemDesc1

field for all of the rows created using the AddRow button appear linked in some fashion. A value entered in any these rows immediately gets propagated to the other rows. This linked-value behavior happens for all of the row fields that have a Non-Normal default binding.



Do I need to explictly change the bindings of the newly added instances to prevent this problem? How would that be done?

Replies

Highlighted

Avatar

20-05-2008

Did you get a respone? I have the same problem. The second and third occurrence or instances seem linked. If I remove the binding it works. I have tried binding the subform, binding the fields independently of the suborm and still the problem persists.
Highlighted

Avatar

22-05-2008

Problem Solved. (well actually just avoided).



I copied row

i r2

to new row

i BlankRow

.



i BlankRow

is the same as

i r2

except all of the bindings have been changed to

b Normal

. I then changed the

i AddRow

button to point to the

i _BlankRow.addInstance

instead of the r2.addInstance



i r2

gets prefilled with my XML data. If a new row is needed, the

i AddRow

button adds a new

i BlankRow

.