struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Hilterbrand" <Bryan.Hilterbr...@bullwinkle.net>
Subject Re: Newbie and use of <logic:iterate>
Date Fri, 13 Sep 2002 23:07:16 GMT
Try this:

    <logic:iterate id="sid" name="allFoo" property="someIds">
        <bean:write name="sid" property="id"/>
    </logic:iterate>

"someIds" is a Collection of beans.  "id" property on an individual bean.
This will work with arrays also, but then you have to specify the type
in the logic:iterate tag.

Bryan

----- Original Message -----
From: "Steve" <sms687@neca.com>
To: <struts-user@jakarta.apache.org>
Sent: Friday, September 13, 2002 2:54 PM
Subject: Newbie and use of <logic:iterate>


Not sure this posted the first time. Sorry in advance if it did.


I have checked the archives and I can still not seem to find a clear way
of how to accomplish the following. I have a collection of beans added
to the request:

request.setAttribute("allFoo", foos);

The beans have a property called 'someIds'( this is a List of id's) ,
along with other properties like name, desc, etc. In my .jsp I simply
need to iterate over the collection of beans displaying the properties
and where applicable iterate over 'someIds'. I have something similar to
this currently:

<logic:iterate name="allFoo" id="aFoo">
    <bean:write name="aFoo" property="title"/>
    <bean:write name="aFoo" property="name"/>
    <bean:write name="aFoo" property="desc"/>
    <logic:iterate name="allFoo" id="sid">
        <bean:write name="sid" property="someIds"/>
    </logic:iterate>
</logic:iterate>

This does not give me the desired result though. Can someone shed some
light on what it is I am doing incorrectly? It seems like a fairly
common thing that I want to do.

Thanks.

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