Frank W. Zammetti wrote:
Rick, what is the real problem here? I ask because what your trying to do seems reasonable to me and I'd probably do something similar, although I probably wouldn't use LazyList (I'd probably build the list manually), but that doesn't really matter. I would *not* use session for this as I can't think of a single good reason to do so (well, aside from maing it WORK of course!).

The problem is Frank when you don't use the Session you will get index out of bounds errors when the form tries to submit since the first thing done is reset all the form values before BeanUtils tries to populate them - so that when the form tries to populate the List items you'll get indexOutOfBounds errors. So for just a one deep List in your ActionForm it's not too big a of deal since a LazyList will work. (I'm curious how would you accomplish this WITHOU using a LazyList or using the Session? - the only other option is in the reset method you make sure you initialize your list add enough items to your List so that when the form submits it will cover all your possible values - way annoying since you need to know the size of the list in the reset method which is a pain - hence the LazyList is just awesome). I'm running into trying to figure out the best scenario for populating at least one more level deep. In other words the source code might look like...

<html type="text" name="foo[3].bar[2].someProperty" value="something"/>

(In my simple case I'm just working with employees[2].phoneNumbers[1] etc)

JSF handles this stuff nicely (although I'm not sure of the mechanics of how it's accomplished, but it works:).



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to