Robert, Damn, I was just replying to your original note when you posted ;-). I'll include my response below in case the "two-step" idea appeals to you:
Not sure if you've moved on from this, but I think you're either gonna have to change the structure of your data or access it in multiple steps. Assuming you can use JSTL and you want direct access (vs. looping) to the nested object at a given index, I think you could do: <bean:define id="sublist" name="form" property='<%= "list[" + index + "]" %>'/> <c:out value="${sublist[index].productId}"/> P.S. I just checked and there's no Struts-EL version of <bean:define>? Would've been helpful here. One of the implications is that "index" has to be both a scripting and scoped variable. Quoting Robert Taylor <[EMAIL PROTECTED]>: > 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] > -- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]