Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Displaying Repeated Data In Multiple Pages

Avatar

Level 2

Hi There,

I'm quite new to LiveCycle and I'm editing quite a large form that somebody built previously. I've got essentially 2 forms, where we fill out a top form on our end (administrators), then hide and lock our 'registration form' and send it off to the end user. Now on the top form, I've created a repeatable table. I've got it to work that when you click 'Add account' on the top registration form, it also adds an instance of that same table on the lower form that the user sees. Essentially I just use the addInstance command to add an instance of each table when I click the button.

My trouble is that I can use data binding or a floating field to display the information entered in the top form in the bottom form, however I can only have either the first instance replicated, or obviously if I use global binding whatever I put in the first instance will repeat for all instances.

How can I get it so that the repeated form attaches a unique ID to each instance that is added, so that when I display the information from the table in the top form, it displays the same way in the lower form?

1 Accepted Solution

Avatar

Correct answer by
Level 10

‌Hi,  The problem here is you are going up the hierarchy when referencing the index, once you are out of the current row you come back down but into the first instance.

Try

estPage.FirstTable.resolveNode("TestPage.FirstTable.FirstTableRow[" + SecondTableRow.index + "]").FirstName.rawValue;


BRuce

View solution in original post

5 Replies

Avatar

Level 10

Hi,

The row of the table has a index property which you can use as a unique ID, starts from 0 and increments by 1 for each row.  So if the second table is all unbound you could have a calculate script to keep the cell values in sync.  Something like;

FirstTable.resolveNode("FirstTableRow[" + SecondTableRow.index + "]").FirstName.rawValue

Here's a sample https://sites.google.com/site/livecycledesignercookbooks/home/SyncTable.pdf?attredirects=0&d=1

Bruce

Avatar

Level 2

Hi,

Thank you very much for the reply. That is exactly what I need, and I open your form and see how it works and it all makes sense! however when I apply it to my forms it still only displays the value from the first instance of table 1 for all instances of table 2. So if I add 3 rows to the top table, and make the values for the rows '1, 2, 3' when I scroll down to look at the second table, it still shows '1, 1, 1'...

Is this happening perhaps becuase the 2 tables are not contained within the same subform, or even the same page? This is how the code looks on my end:

form1.AuditRegP1.Company_Info_CU.Table2.resolveNode("Row1[" + form1.Page1.TableParent_Company.TableBodyRow1.index + "]").Legal_Company_NameRow1.rawValue

I think I'm very close to what I need here, I'm just not sure what to edit to make it work for my application.

Avatar

Level 2

So, sorry double reply to my own thread but I've at least surmised that the issue is the fact that my 2 tables are on 2 separate pages. So I've taken your examples code and broken the 2 tables apart over 2 pages, and confirmed the exact same thing happens. What seems to be happening is that the index for table 2 returns the value of 1, so of course each row in SecondTable.SecondRow.FirstName/LastName will returnwhatever value I enter for FirstName/:LastName in FirstTable.FirstRow.FirstName/LastName

Here is the code from your example, except I separated the tables by putting FirstTable on a page I named 'TestPage' and SecondTable on a subsequent page called 'TestPage2' to replicate what I have form my own form:

TestPage.FirstTable.resolveNode("TestPage.FirstTable.FirstTableRow[" + TestPage2.SecondTable.SecondTableRow.index + "]").FirstName.rawValue;

What am I doing wrong here? Everything seems to be referenced properly?

Avatar

Correct answer by
Level 10

‌Hi,  The problem here is you are going up the hierarchy when referencing the index, once you are out of the current row you come back down but into the first instance.

Try

estPage.FirstTable.resolveNode("TestPage.FirstTable.FirstTableRow[" + SecondTableRow.index + "]").FirstName.rawValue;


BRuce

Avatar

Level 2

Thank you very much, that was it! This was so frustrating, I( really appreciate the help.