You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Ragan <ma...@voxpath.com> on 2001/07/17 01:08:48 UTC

Nested Attributes on Collections

It appears, or at least I've read that struts allows nested attribute
specifications in the tag properties, such as property="user.name.last".  Is
this only when the nesting is in the form class?
 
Is it possible to specify nested collections in another class.  For example,
suppose class Container(instance container) has two Collections(listA and
listB).  Is there any way to specify one of those list in the collection
parameter of an html:options tag, such as collection="container.listA"?  Or
alternately, is there a way to specify that the collection should be a
method?
 
thanks for your help, Mark

Re: Nested Attributes on Collections

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 16 Jul 2001, Mark Ragan wrote:

> It appears, or at least I've read that struts allows nested attribute
> specifications in the tag properties, such as property="user.name.last".  Is
> this only when the nesting is in the form class?
>  
> Is it possible to specify nested collections in another class.  For example,
> suppose class Container(instance container) has two Collections(listA and
> listB).  Is there any way to specify one of those list in the collection
> parameter of an html:options tag, such as collection="container.listA"?  Or
> alternately, is there a way to specify that the collection should be a
> method?
>  

If you declare "container" with a <jsp:useBean> tag, you would be able to
use a runtime expression for this:

  <html:options ... collection="<%= container.getListA() %>" ... />

> thanks for your help, Mark
> 

Craig McClanahan