You can do it this way

<logic:iterate name="mailFilterForm" property="registredList" id="mailView">
  <bean:define id="index" name="mailView" property="index"/>
  <tr>
     <td class="<%= (Integer.parseInt(index)%2 == 0)?"paire":"impaire"%>">
        <bean:write name="mailView" property="sender"/>
     </td>
  </tr>
</logic:iterate>


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 29, 2002 4:02 PM
Subject: defining style class with the iterate tag


> hi all,
>
> I'm using the iterate tag to display my arrayList element like this.
>
> <logic:iterate name="mailFilterForm" property="registredList"
id="mailView">
>
>           <tr class="paire">
>                <td align="center"><bean:write name="mailView"
> property="code"/></td>
>                <td><bean:write name="mailView" property="sender"/></td>
>                <td><bean:write name="mailView" property="dateStart"/></td>
>                <td><bean:write name="mailView" property="dateEnd"/></td>
>                <td><bean:write name="mailView" property="targetDir"/></td>
>
>           </tr>
>                 </logic:iterate>
>
> and it works fine.
>
> But I would like to define row style class in bold according to the index
value
> of the iterated element.
>
> without using the tag is looked like this
> <tr class="<%= (index%2 == 0)?"paire":"impaire"%>">
>  where index is the index value of the iterated element.
> But I don't know how to perform this inside the iterate tag.
> The mailView object has a property named index could be used
> to perform some comparison. But I don't know how to use it.
>
> Can some one helps ?
>
> thanks.
>
> Meissa
>
>
>
>
> --
> 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>

Reply via email to