You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lisa ward <li...@hotmail.com> on 2001/11/05 12:31:30 UTC

logic:equal tag

Hi,

I am trying to use the value of the iterator tag's indexId attribute in a 
logic equal/notEqual tag.  I would like to find the modulus of the value and 
do something different if the value is odd or even.  Here is an example of 
what I mean.

<logic:iterate id="order" indexId="index" name="orderList">
   <tr>
      <logic:equal parameter="<%= index % 2 %>" value="0" >
         <td> This value is even </td>
      </logic:equal>

      <html:img src=?? height=?? width=?? .. />

      <logic:notEqual parameter="<%= index % 2 %>" value="0" >
         <td> This value is odd </td>
      </logic:notEqual>
   </tr>
</logic:iterate>

I want the text to appear on either side of the image depending on whether 
the value is odd or even.  orderList is an array list of values.  I hope 
this makes sense.

Please help.

Thankyou for your speedy response.

Lisa





_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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