struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: Multiple <logic:iterate> still unclear
Date Mon, 16 Sep 2002 16:32:02 GMT
This *could* be caused by a semantic error in how you build the authorIds collection.  Check
to make sure that all the objects are indeed in the collection.

Sri
  

> -----Original Message-----
> From: Steve [mailto:sms687@neca.com] 
> Sent: Monday, September 16, 2002 12:25 PM
> To: struts-user@jakarta.apache.org
> Subject: RE: Multiple <logic:iterate> still unclear
> 
> 
> Thanks that helped with the inner interate count. However it 
> is only displaying the last item in the List:
> 
> <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="aBook" property="authorIds">
>        <bean:write name="aAuthor"/><br>
>     </logic:iterate>
> </logic:iterate>
> 
> Displays:
> 1
> Book 1 desc
> 40
> 
> Instead of:
> 1
> Book 1 desc
> 10
> 20
> 30
> 40
> 
> Sorry if this is something obvious that I am missing.
> 
> steve
> 
> -----Original Message-----
> From: Victor CHEVALIER [mailto:vch@avs-consulting.com] 
> Sent: Monday, September 16, 2002 9:02 AM
> To: Struts Users Mailing List; sms687@neca.com
> Subject: RE: Multiple <logic:iterate> still unclear
> 
> 
> 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>
> 
> 
> 
> --
> 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