You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by me...@bpam.fr on 2002/10/29 13:02:21 UTC

Réf. : Re: defining style class with the iterate tag

thank you for your suggestion.
it works fine.

Meissa




"deepak" <de...@ltp.soft.net> on 29/10/2002 12:29:10

Veuillez répondre à "Struts Users Mailing List" <st...@jakarta.apache.org>

Pour :    "Struts Users Mailing List" <st...@jakarta.apache.org>
cc :
Objet :   Re: defining style class with the iterate tag


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: <me...@bpam.fr>
To: <st...@jakarta.apache.org>
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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>








--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>