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

addInstance creating rows with fields bound together (but shouldn't)

ChrisFreeman
Registered: May 6 2007
Posts: 19
Answered

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[/b] and [b]$record.item[*].ItemDesc1[/b] , etc. which are used during prefill.

The strange behavior is that the [i]ItemDesc1[/i] 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.

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

ChrisFreeman
Registered: May 6 2007
Posts: 19
Problem Solved. (well actually just avoided).

In the hierarchy, I copied row [i]r2[/i] to newly defined row [i]BlankRow[/i].

[i]BlankRow[/i] is the same as [i]r2[/i] except all of the bindings have been changed to [b]Normal[/b]. I then changed the [i]AddRow[/i] button to point to the [i]_BlankRow.addInstance[/i] instead of the [i]r2.addInstance[/i].

[i]r2[/i] gets prefilled with my XML data. If a new row is needed, the [i]AddRow[/i] button adds a new [i]BlankRow[/i].