Tabular Inputs This suggests to use XWorkList
instead of ArrayList
, when the size of array is unknown & there are gaps in between.
But XWorkList
is not generic & it has no empty constructor, according to documentation.
My question is how to use XWorkList
or is there any way to submit list of beans with some items missing in the list ?
Sample Html:
<input name="lst[0].name"/>
<input name="lst[3].name"/>
<input name="lst[4].name"/>
A
List
contract is an ordered collection. It can't have missing indeces. AboutXWorkList
it's just an other implementation of the list, capable of creating new elements for the specified index by filling gap for required elements. What is said foradd(int, Object)
Another approach for creating new beans in the list is to use type conversion. Or using annotations like in this answer.