FAQ

On 11/10/06, Van Nguyen wrote:

I have two ArrayList that I need to iterate through:
<logic:iterate id="line" indexId="indexId" name="collection1">
<bean:write name="line" />
// write info contained in collection2
// something like this… but not working??
<bean:write name="collection2[indexed]" />
</logic>

collection1 and collection2 will always have the same number of records…
That you need to do this probably means "two ArrayLists" is the wrong
data structure. How about a single array list of some object that has
two properties? Or a Map? I can't tell what you're doing from the
contrived example.

If you must do it, <logic:iterate> exposes the current index as
'indexId' which might help.

http://struts.apache.org/1.x/struts-taglib/tlddoc/logic/iterate.html

--
Wendy

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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
groupuser @
categoriesstruts
postedNov 10, '06 at 7:57p
activeNov 13, '06 at 12:02a
posts5
users4
websitestruts.apache.org
irc#struts

People

Translate

site design / logo © 2022 Grokbase