You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by dave beres <da...@hotmail.com> on 2002/10/17 23:25:02 UTC
problem accessing outer object within nested logic:iterate
Hi,
I've got the following code on a jsp page (line numbers added for
convenience):
1<logic:iterate id="category" name="accountForm" property="categoryList">
2 <tr>
3 <td><bean:write name="category" property="cat_name" /></td>
4 <td>
5 <logic:iterate id="type" name="accountForm" property="typeList">
6 <logic:equal name="type" property="cat_id" value="#HERE#">
7 <bean:write name="type" property="type_name" />,
8 </logic:equal>
9 </logic:iterate>
10 </td>
11 </tr>
12</logic:iterate>
I need to display the type_name (on line 7) only when the type's cat_id
equals the category's cat_id.
Ideally, I'd replace #HERE# on line 6 with <bean:write name="category"
property="cat_id" />, however that doesn't seem to work.
Any suggestions would be appreciated. Thanks.
Dave
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: problem accessing outer object within nested logic:iterate
Posted by Eddie Bush <ek...@swbell.net>.
If you can use the JSTL, look at using the struts-el contributed taglib.
This is the sort of situation in which you'll find it invaluable.
dave beres wrote:
> Hi,
>
> I've got the following code on a jsp page (line numbers added for
> convenience):
>
> 1<logic:iterate id="category" name="accountForm" property="categoryList">
> 2 <tr>
> 3 <td><bean:write name="category" property="cat_name" /></td>
> 4 <td>
> 5 <logic:iterate id="type" name="accountForm" property="typeList">
> 6 <logic:equal name="type" property="cat_id" value="#HERE#">
> 7 <bean:write name="type" property="type_name" />,
> 8 </logic:equal>
> 9 </logic:iterate>
> 10 </td>
> 11 </tr>
> 12</logic:iterate>
>
> I need to display the type_name (on line 7) only when the type's
> cat_id equals the category's cat_id.
>
> Ideally, I'd replace #HERE# on line 6 with <bean:write name="category"
> property="cat_id" />, however that doesn't seem to work.
>
> Any suggestions would be appreciated. Thanks.
>
> Dave
--
Eddie Bush
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>