Not being familiar with lazyList, I thought you didn't have to do
anything to get it to populate from the request params (or would that be
too lazy?)
since you're thinking of coding in the reset() anyway, then you should
do a check on the size of the array you need there and size your array
accordingly.
Sorry if this is wide of the mark but this is way too early in the
morning for me.
On 10/13/2004 04:43 AM Rick Reumann wrote:
> Adam Hardy wrote the following on 10/12/2004 5:46 PM:
>
>> I thought that the servlet container would just pass in the parameter
>> 'tier' as an array of the appropriate size already, in one hit so to
>> speak.
>>
>> Or am I totally wrong?
>
>
> I'm sure it would if I defined each property in the form like...
>
> <... property="tier" ../>
> <... property="tier" ../>
> <... property="tier" ../>
>
> When it submits it would populate them into my array fine. I'm running
> into trouble because I'm defining them as
>
> <... property="tier[0]" ../>
> <... property="tier[1]" ../>
> <... property="tier[2]" ../>
>
> (I'm only doing this because I have to do some funky javascript stuff
> and it's much easier calling the field I'm concerned with by name (ie
> tier[0] )
>
> I'm probably just doing something stupid that I can't get this to work
> as expected.
>
> <original post below:>
> ----------------------
>
> I have a situation where I need to use fields on form that are indexed...
>
> tier[0], tier[1], etc. (possibly more)
>
> Is there a way I could use a LazyList implmentation to grow this if the
> form property is defined as String[]? (I know how to grow a List in the
> reset using LazList but not sure of an easy way to do this with an array
> unless I create my own setters that will grow the array and use those
> different setters in the form ie. tierIndexed[0] etc )
>
> TIA for any help. (If I hardcode a size in the reset for the array
> things are fine, but of course I want to avoid just declaring some
> arbitrary size).
>
> I've looked over Niall's wiki but still stumped on this since that wiki
> is dealing with dyna implementations
> http://wiki.apache.org/struts/StrutsCatalogLazyList
>
>
--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
|