Expand my Community achievements bar.

SOLVED

How do I keep track of rows that I add to a table so that I can later update or delete them?

Avatar

Level 2

A> The form has a set of text field and dropdown list inputs.  After the user puts data into a specific text field, on change, I need to add their data to a table on the first time through.   There are lots of different sets of inputs that would each have their own row.

B> Later the user comes back and edits the data in one of the fields.  I need to update that specific row with the new values.

C> Later the user comes back and deletes data completely from one of the fields so I need to delete that specific row from the table.

D> The user does not manage the table directly.  The table summarizes inputs that are made into the text and drop down fields.  I need to be able to keep the table in sync with the user inputs.

I am okay with adding rows to a table, but I'm not sure what the best way is to keep the rows in sync.   I have a fair amount of Java programming experience under my belt but I only have a few projects in LiveCycle.

I'm quite willng to read if you have any online reference material for managing dynamic tables.  So far the only info I've found is how to add and delete rows, but not how to keep track of them.

Any help is greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Ah sorry missed that you weren't using two tables.

Are you using repeating rows or is there a specific row for each set of data?

You could just hard-code where the data goes - A data goes into RowA. On the Exit even of the field you would just have: table.rowA.rawValue = this.rawValue;

You could use Global Binding on fields: the fields taking the data entry have the same name as the fields in the table and then the data updates automatically.

For the blank rows you would need to check if there's any data in the fields and if no data you can hide the row: RowA.presence = "hidden"; 

View solution in original post

4 Replies

Avatar

Level 2

Thanks for the pointer.  I had read that but it doesn't really give me any help on trying to keep track of what row the data is in.

Let's say you have 5 different sets of data.  Let's call it A, B, C, D and E and let's also say that each set of data corresponds to a specific row in the table.   The rows could be in any given order.

When someone puts data into fields associated with "A", I need to be able to update row "A".  When comes back later and changes data in fields associated with "A" then the row "A" in the table needs to be updated.     What can I use to keep track of what rows the data is in without having a bunch of blank lines in between data sets.   (Not all fields will be filled in.  Sometimes it might just be fields associated with A and D, but then it might be fields with B and C or any other combination.)

If I hardcode row names, I fear that I'll end up with blank lines in the table. 

Avatar

Correct answer by
Level 10

Ah sorry missed that you weren't using two tables.

Are you using repeating rows or is there a specific row for each set of data?

You could just hard-code where the data goes - A data goes into RowA. On the Exit even of the field you would just have: table.rowA.rawValue = this.rawValue;

You could use Global Binding on fields: the fields taking the data entry have the same name as the fields in the table and then the data updates automatically.

For the blank rows you would need to check if there's any data in the fields and if no data you can hide the row: RowA.presence = "hidden"; 

Avatar

Level 2

No problem at all.  Thanks a bunch for the added advice and information.   That is sort of the way I had started to proceed.  It's good to know I was on the right track and the bit about the global binding is especially helpful!