Global Binding and add row query

Avatar

Avatar
Level 1
KerryC08
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
KerryC08
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
KerryC08
Level 1

14-09-2016

I have two tables.  In table 1 I have global binding to text fields to duplicate data into table 2. In table 1 I have an 'add row' button.  I would like to know how, when I add a row, to not have the text from the row above appear in the new row

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

19-09-2016

Hi,

I don't believe you can achieve what you want with global binding, this has the effect of assigning all fields with the same name the same value and as the fields in the second row will have the same names as fields in the first row, they will also have the same values.

One way of achieving what you want it to have a calculate event script in the second table that copies values over, something like;

var rows = xfa.resolveNodes("Table1.Row1[*]");

_Row1.setInstances(0);      // make sure min count is zero

for (var i = 0; i < Table1._Row1.count; i++) {

      var sourceRow = rows.item(i);

      var sourceFields = sourceRow.resolveNodes("#field[*]");

      var destinationRow = _Row1.addInstance();

      for (var j = 0; j < sourceFields.length; j++) {  

           var sourceField = sourceFields.item(j);

           var destinationField = destinationRow.resolveNode(sourceField.name + "[" + sourceField.index + "]");

           if (destinationField !== null) {

                destinationField.rawValue = sourceField.rawValue;

           }

      }

}

You will have to change the names for the first table (Table1 in this code) and the row in the first table (Row1), here is a sample form https://sites.google.com/site/livecycledesignercookbooks/home/CopyTable.pdf?attredirects=0&d=1

Regards

Bruce

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

15-09-2016

[Question moved to the LiveCycle Designer forum]

Avatar

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
Bernd_Alheit
Level 2

14-09-2016

Try the forum for LiveCycle Designer.