struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <martin.coo...@tumbleweed.com>
Subject RE: Use of Iterator tag
Date Wed, 14 Aug 2002 19:27:14 GMT


> -----Original Message-----
> From: nathan phillips [mailto:nathanpp@hotmail.com]
> Sent: Wednesday, August 14, 2002 9:33 AM
> To: struts-user@jakarta.apache.org
> Subject: Use of Iterator tag
> 
> 
> 
> Hello all,
> 
> I'm new to Struts and attempting to make use of the iterator 
> tag.  I have a 
> couple questions that I'm hoping some kind individual can 
> help me answer in 
> regards to the iterator tag.  I have a bean with a method 
> named "iterator" 
> that returns an iterator.
> 
> If I do this it tells me I have no getter for my method 
> iterator, which of 
> course is true.
> <logic:iterate name="testbean" property="iterator" id="test">
> 
> So how do I make it work.  I see that there is a collection 
> attribute that 
> might work but I'm unsure of how exactly to make use of it.  
> I was thinking 
> something along the lines of:
> <logic:iterate name="testbean" collection=<%=testbean.iterator()%> 
> id="test">
> 
> Of course that doesn't work though.

If the collection in your bean is exposed through an accessor (e.g. as a
Collection), you can use that directly, and Struts will obtain an iterator
from it.

--
Martin Cooper


> 
> My second question is how would do I write out a property for 
> the radio tag 
> within a iterator tag.  I'm attempting the following with no 
> success.  It 
> tells me "test" is out of scope however the same bean:write 
> works fine 
> outside of the radio tag.
> 
> <logic:iterate name="testbean" property="iterator" id="test">
>   <html:radio property="myId" value="<bean:write name="test" 
> property="id"/>"
> </logic:iterate>
> 
> Any help in solving these mysteries for me would be greatly 
> appreciated.  
> Thanks.
> 
> 
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> --
> 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