cancel
Showing results for 
Search instead for 
Did you mean: 

Initialising all occurrences of a field within a table

Former Member
0 Kudos

Hi,

New to SAP Adobe and complete novice at scripting.

I have an interactive form with a table which contains a grouping; hierachy view looks like this:

data

     subform1

          table1

               data (row)

                    field1 (grouping field)

                    table2

                         data (row)

                              field2

                              field3

                              field4

Field4 is the only input field in the table; there is another input field outside of the table (fieldA).

I have a pushbutton which I would like to initialise all occurrences of field4 and the single fieldA.

Managed fieldA fine with resetData, but don't know how to do all field4's.

I'm guessing I need to loop at all occurrences of table1, and within that loop, all occurrences of table2, and (resetData?) each field4 that way?

Apologies if this has been covered before, I've searched but not found....

Not even sure if I should be experimenting with formcalc or javascript for this solution?

Any help would be much appreciated.

Thanks.

Nigel. 

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Moved forward a little I think.

When I have two groups of 10 rows in the table, like:

Group1     f1     f2     f3     f4

               f1     f2     f3     f4

               f1     f2     f3     f4

               &etc. for 10 rows

Group2     f1     f2     f3     f4

               &etc. for 10 rows

then this works:

for (var iRow = 0; iRow < 2; iRow++)

{

  for (var nRow = 0; nRow < 10; nRow++)

       {

       xfa.host.resetData("data.subform.table1.data[" + iRow + "].cell_table.data[" + nRow + "].field4");

       }

}

Sadly I don't know how many groups or rows within groups there are....!

Having got this far can someone point me towards the finish line - how can I tell how many groups (entries) there are in table 1, and within each of table 1, how many in cell_table?

Thanks....