Is it possible to get back 2D arrays from a form?

 

I want to be able to have a table with some number of rows. Each row has a
'grouping' field which the user can enter a number in. Each row will also
have a dynamic 'foo' column which will have a button to add additional 'foo'
values. Some javascript will drop in new 'foo' textfields on a given row
whenever that row's button is clicked.

 

I want to be able to collect an int[] grouping array, which is straight
forward. Iterating over a collection to create textfields will let me get an
int[] in my action which will be the list of groupings indexed by row (so
grouping[0] yields the entered value for the first row, grouping[3] yields
the entered value for the fourth row, etc.)

 

I also want to be able to collect an int[][] foo array. This should be an
int[] array of foo values indexed by row. This is less straightforward and
I'm not sure how to approach this. Are there any sorts of similar examples
to this floating around?

Reply via email to