Okay. After looking at PropertyUtils I determined that this sort of syntax
is not allowed when accessing an object from an ArrayList of ArrayLists.
You have to wrap the child lists in an object which provides some type of
accessor/mutator. So in my case I have an ArrayList of ListWrapper objects.
Where each ListWrapper contains a List and getList()/setList(). Then the
syntax below
works - assuming my form bean has the methods getList()/setList().

list[index].list[index].property


Kind of a PIA to have to wrap the nested lists. Seems like PropertyUtils
would contain logic to recognize this use case but as I look at the source
code for getIndexedProperty, the necessary modifications would be none
trivial.

robert

> -----Original Message-----
> From: Robert Taylor [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 5:15 PM
> To: [EMAIL PROTECTED]
> Subject: Syntax for accessing an object nested in a List of Lists
>
>
> I've run into some trouble accessing a nested object in my form.
> The object "lives" in a List of Lists type of structure.
>
> I've been using a syntax like the following assuming my List form
> property is named 'list'.
>
> list[index].[index].productId
>
> This must be wrong because I get the following exception:
>
> No getter method available for property list[0].[0].productId for
> bean under
> name org.apache.struts.taglib.html.BEAN'
>
> I tried the following just to make sure it could find the 'first level'.
>
> list[index]
>
> This doesn't cause any exceptions, so I must have the syntax
> wrong for accessing the 'second level' of the structure.
>
>
> Any help would be appreciated?
>
> robert
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to