struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arron Bates <struts-u...@keyboardmonkey.com>
Subject Re: <nested:iterate> & building columns
Date Wed, 23 Oct 2002 11:09:14 GMT
On Tue, 2002-10-22 at 01:02, Adam Sherman wrote:
> Arron Bates wrote:
> >>What about a Set?
> > 
> > List and Map implementations only. Only because the properties for
> > getting at an item in a collection needs a key. int's for lists and
> > arrays, and objects (strings) for the mapped collections. Set is just a
> > bunch, and there's no way in an iteration for the system to be able to
> > get a specific item. This is in relation to updating from a request, and
> > in the nested tags case, drawing the output in the first place.
> 
> Since a Set has an iterator() method, and <logic:iterate> supports using 
> an Iterator, souldn't it be modified to automatically get an iterator 
> for Collections that are Sets?

In all truth, this is out of my hands.
The original iterate tag can use a collection, or an iterator or
whatever. Why?... because when looping, the tag pulls the next object
out of the iterator and stores it for the iteration. All the child tags
have this "artificial" lookup of the current object when evaluating. It
doesn't use a proper property lookup of the bean using BeanUtils.

The nested tags... Nothing is actually stored or used by the
nested:iterate tag. The child tags takes the nested property reference
set by the iterate tag, and evaluates the resulting property using
BeanUtils. This is exactly how the Struts controller servlet sets the
incoming beans.

Result of all this, nested tags can only use arrays, Lists and Maps for
iterations, but on the other hand they can be set properly when going
back to the server via a form. The original tags on the other hand can
show content in a collection, but this imformation will never be updated
when hitting the server again.


Arron.


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message