It’s come up one or twice that I’ve wanted to create an interface where a user could enter data into a list, but where the rows in the list do not map to records in a db table but rather are just local, temporary rows of data for local processing.
For example, let’s say I had table with 50 columns of data, and I want to generate an interface that lists all the columns with an editable field next to each one where the user can enter a value for that column, like below:
column 1 :
column 2 :
column 3 :
etc.
column n:
Of course I can build a form by hand that does this, but is there a way to generate this sort of list-based data entry interface dynamically?
I’m not quite sure why you would want to do that and if I did know that I might respond differently. But it looks from the picture you have drawn that you are talking about an array (one row, multiple columns of entry) as opposed to an an array of an array (multiple rows, multiple columns). If this is the case would it suffice for you to have 50 (really 50? that’s a lot) global columns?
The label for them (column1, column2, etc.) could be set dynamically (depending on what table the user is using, some developer criteria or whatever) as well as the number and visibility of labels. Based on those column labels, the visibility of the ‘related’ editable global fields would be determined. Then after entering the data at some point you will want to extract that data I presume and assign it to the appropriate table columns. For this you would then use the label text to extract back out the right information for the right table/row/column.