Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Show repeating table data in another subform

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

01-08-2019

Hi,

I have made a repeating table with 2 fields and a script, but the data will not show up in the other subform:

The table data have to show up in 3 subform floating field areas.

Hope anyone can tell me what's not good or perhaps anyone has a better function.

The script is:

function doeIets() {

//    myOutput('BLAAT');

   

var vItems = form1.sub2aOverheidsorgaan.subTaakWerkzaamheden.dataAanvragers.tableAanvragers.Row1.txtOmschrijvingTaakOverheidsorgaan.all;

    for(i=0; i<vItems.length; i++) {   

   

                // Show the input

                vItems.item(i).sub3InhoudAutorisatie.presence = 'visible';

       

                // Show the output

                form1.sub3InhoudAutorisatie.subInladenTaak.Antwoord.all.item(i).presence = 'visible';   

               

                // Fill the output

                var txtOmschrijvingTaakOverheidsorgaan = vItems.item(i).txtOmschrijvingTaakOverheidsorgaan.rawValue;   

                form1.sub3InhoudAutorisatie.subInladenTaak.Antwoord.all.item(i).fltTaakOmschrijving.rawValue = txtOmschrijvingTaakOverheidsorgaan;

               

                break;

        }

    }

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

09-08-2019

In this scenario it is better to use a more generic function which is usable for multiple tables.

/** generic function to collect data

*   @param oTable:      object          table to take data from

*   @param oOutput:    object          textfield the results are written to

*   @param aCellNames:    array          variable array of field names in oTable to be analysed

**/

function collectData (oTable, oOutput, aCellNames) {

var oRows = oTable.resolveNodes("Row1[*]"),

i, cResult = "";

for (i = 0; i < oRows.length; i += 1) {

cResult += i > 0 ? "\n" : ""; // line break

aCellNames.forEach(function (cellName, iName) {

var oCell = oRows.item(i).resolveNode(cellName);

if (oCell) {

cResult += iName > 0 ? " " : "" // space

cResult += oCell.isNull ? "" : oCell.rawValue;

}

});

}

oOutput.rawValue = cResult;

}

You now call the function with a third parameter from the individual table cells.

EAAFscript.collectData (tableAanvragers, form1.page1.subTaakWerkzaamheden.subInladenTaak.Antwoord.fltTaakOmschrijving, ["txtOmschrijvingTaakOverheidsorgaan", "txtRegelgevingInstellingTaakOverheidsorgaan"]);

The scheme it as follows:

collectData (TableForInput, TextfieldForOutput, ["Field1InTableRow", "Field2InTableRow", …]);

Answers (13)

Answers (13)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

02-08-2019

Ok,

to collect the data of all rows use this function:

var oRows = oTable.resolveNodes("Row1[*]"),

i, cResult = "";

for (i = 0; i < oRows.length; i += 1) {

cResult += oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.rawValue;

cResult += " "; // space

cResult += oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.rawValue;

cResult += "\n"; // new line

}

oOutput.rawValue = cResult;

}

Call it from the exit event of you text fields within the table row.

EAAFscript.collectData (tableAanvragers, form1.page1.subTaakWerkzaamheden.subInladenTaak.Antwoord.fltTaakOmschrijving);

Hope this helps.

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

12-08-2019

HI Radzmar,

This function is great and works.

Regards,

Ed

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

09-08-2019

Hi Radzmar,

The same sort of table with only a change in the field as: txtOmschrijvingTaakDerde.

Regards,

Ed

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

09-08-2019

Hi Ed,

what does the second table look like? I need to know its structure to answer this question.

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

05-08-2019

HI Radzmar,

Thanks, this is working.

I now want to use the same function in a similar subform.

I did this with a second functioncollectData2:

function collectData (oTable, oOutput) { 

    var oRows = oTable.resolveNodes("Row1[*]"),  

         i, cResult = "";  

     

         for (i = 0; i < oRows.length; i += 1) { 

              cResult += oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.rawValue;

              cResult += " "; // space

              cResult += oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.rawValue;

              cResult += " "; // space      

              cResult += "\n"; // new line

         }  

         oOutput.rawValue = cResult;  

    } 

  function collectData2 (oTable, oOutput) { 

    var oRows = oTable.resolveNodes("Row1[*]"),  

         i, cResult = "";  

     

         for (i = 0; i < oRows.length; i += 1) { 

              cResult += oRows.item(i).txtOmschrijvingTaakDerde.isNull ? "" : oRows.item(i).txtOmschrijvingDerde.rawValue;

              cResult += " "; // space      

              cResult += "\n"; // new line

         }  

         oOutput2.rawValue = cResult;  

    }

Can I do this like above written script. Hope you can help me.

Regards,

Ed

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

05-08-2019

Hi Ed,

sorry, the previous script sample was incomplete for some reason. The function has to look this way.

function collectData (oTable, oOutput) {

var oRows = oTable.resolveNodes("Row1[*]"),

     i, cResult = "";

     for (i = 0; i < oRows.length; i += 1) {

          cResult += oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtOmschrijvingTaakOverheidsorgaan.rawValue;

          cResult += " "; // space

          cResult += oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.isNull ? "" : oRows.item(i).txtRegelgevingInstellingTaakOverheidsorgaan.rawValue;

          cResult += "\n"; // new line

     }

     oOutput.rawValue = cResult;

}

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

03-08-2019

Hi Radzmar,

I place the function in the variable script and the exitscript on the origin fields.

But no result.

https://www.dropbox.com/s/zaig9rr0g24yrs9/EAAF_taken.pdf?dl=0

Perhaps something I missed.

Regards,

Ed

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

02-08-2019

Hi Radzmar,

thanks, will check it.

Regards,

Ed

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

02-08-2019

Hi Bruce,

I have checked it and made some corrections.

This is the new script:

function doeIets() {

//    myOutput('BLAAT');

   

                // Taken overheidsorgaan

                var vItems = form1.sub2aOverheidsorgaan.subTaakWerkzaamheden.dataAanvragers.tableAanvragers.Row1.all;

                for(i=0; i<vItems.length; i++) {

                app.alert(vItems.length)    //working

                // Show the input

                vItems.item(i).txtOmschrijvingTaakOverheidsorgaan.presence = 'visible';

               

                // Show the output

                form1.sub3InhoudAutorisatie.subInladenTaak.Antwoord.all.item(i).presence = 'visible';

                // Fill the output

                var txtOmschrijvingTaakOverheidsorgaan = vItems.item(i).txtOmschrijvingTaakOverheidsorgaan.rawValue;       

                form1.sub3InhoudAutorisatie.subInladenTaak.Antwoord.all.item(i).fltTaakOmschrijving.rawValue = txtOmschrijvingTaakOverheidsorgaan;   

                           

                break;

        }

    }

Still showing 1 input:

subFormTargetResult.PNG

I have made an extraction of the form with only 2 sections.

https://www.dropbox.com/s/3ptnzt79g9h1fq8/EAAF_taken.pdf?dl=0

Hope you can see what the issue is.

Regards,

Ed

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

01-08-2019

HI Bruce,

Thanks again. The counter does what it has to do.

Now only showing the output.

I will check this out.

Regards,

Ed

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

01-08-2019

Hi Ed,

Makes it tricky not seeing the whole thing but understand the conventionality stuff.

I don't understand this line;

var vItems = form1.sub2aOverheidsorgaan.subTaakWerkzaamheden.dataAanvragers.tableAanvragers.Row1.txtOm schrijvingTaakOverheidsorgaan.all;

The all property will return all like named objects so I would expect to see

var vItems = form1.sub2aOverheidsorgaan.subTaakWerkzaamheden.dataAanvragers.tableAanvragers.Row1.all;

if you add a line after that one "app.alert(vItems.length)" do you get the number you expect?

Avatar

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
visioned
Level 1

Like

1 like

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
visioned
Level 1

01-08-2019

Hi Bruce,

Thanks for your reaction:

I cannot submit the form because of confidentional status.

Attached 2 screenshots.

Start subform with table to fill in data

subFormOrigine.PNG

Target subform where data has to come:

subFormTarget.PNG

Please let me know.

Regards,

Ed

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

01-08-2019

Hi,

We might need a bit more, can you share your form so we can have a look (post a link to it in this thread) or maybe add a screen shot of the hierarchy

Regards

Bruce