struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor CHEVALIER" <...@avs-consulting.com>
Subject RE: Multiple <logic:iterate> still unclear
Date Mon, 16 Sep 2002 13:02:02 GMT
I think you should write in the second iterate :

<logic:iterate id="aAuthor" name="aBook" property="authorIds">

this means you iterate through the authors of aBook.

-----Message d'origine-----
De : Steve [mailto:sms687@neca.com]
Envoye : lundi 16 septembre 2002 14:53
A : struts-user@jakarta.apache.org
Objet : Multiple <logic:iterate> still unclear


I am still unclear as to how to use multiple <logic:iterate> tags. Can
anyone shed some light on this for me. I currently have the following in
my .jsp:

<logic:iterate  id="aBook" name="allBooks">
    <bean:write name="aBook" property="id"/><br>
    <bean:write name="aBook" property="desc"/><br>
    <logic:iterate id="aAuthor" name="allAuthors">
       <bean:write name="aAuthor" property="authorIds"/><br>
    </logic:iterate>
</logic:iterate>

allBooks is a collection of Book beans. The Book bean has the
appropriate getters and setters, where the getAuthorIds returns a List.
With the current markup my output is this:

1
Book 1 desc
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20, 30, 40]

I am currently working with just 4 books, so it would seem that the
nested <logic:iterate> is iterating over the number of books as opposed
to the number of elements in the authorIds List. I have searched the
archives and still can not seem to get this straight. I simply want to
display:

1
Book 1 desc
10
20
30
40

What should my syntax for the inner <logic:iterate> resemble? Or am I
doing something else fundamentally wrong?

Tia.

steve





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


--
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