You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Srikanth Gubba <sg...@lylesdata.com> on 2003/10/22 21:24:12 UTC

Logic Iterate --URGENT Please

Hi all,

I have a doubt using logic iterate:

Is it possible to display a row in a different color based on a value of the
bean while iterating it?

Actually, I am displaying the tax history of a person and I want to
highlight the row or a field (tax owed) to red color if the tax paid column
shows delinquent. 

Please let me know if u have any suggestions or ideas. 

Thanks in Advance,
Srikanth Gubba.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Logic Iterate --URGENT Please

Posted by Lukas Bradley <lu...@somnia.com>.
<logic:iterate name="taxHistoryArray" id="source"
type="org.gubba.TaxHistory" indexId="i">
   <tr align="center" <% if (history.isDelinquent) { %> bgcolor="red" <% }
%> >
   ..... other stuff in row
   </tr>
</logic:iterate>

Maybe not as pretty as you want....

Lukas

"Srikanth Gubba" <sg...@lylesdata.com> wrote in message
news:76883B4A567AE1449382F75E3B1E90DC57B295@lds-1.lylesdata.com...
> Hi all,
>
> I have a doubt using logic iterate:
>
> Is it possible to display a row in a different color based on a value of
the
> bean while iterating it?
>
> Actually, I am displaying the tax history of a person and I want to
> highlight the row or a field (tax owed) to red color if the tax paid
column
> shows delinquent.
>
> Please let me know if u have any suggestions or ideas.
>
> Thanks in Advance,
> Srikanth Gubba.




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Logic Iterate --URGENT Please

Posted by Greg Dunn <gr...@mo.nisc.cc>.
<logic:iterate id="myBean" name="MyBeans" type="com.mine.bean.MyBean">
  ...
  <logic:lessThan name="myBean" property="taxOwed" value="0">
    <td bgcolor="red">
  </logic:lessThan>
  <logic:greaterEqual name="myBean" property="taxOwed" value="0">
    <td bgcolor="white">
  </logic:greaterEqual>
  ...
</logic:iterate>

You could also do it with JSTL:

<c:forEach items="sessionScope.myBeans" var="myBean">
  ...
  <c:if test="${myBean.taxOwed < 0}"><td bgcolor="red"></c:if>
  <c:if test="${myBean.taxOwed >= 0}"><td bgcolor="white"></c:if>
  ...
</c:forEach>



Greg

-----Original Message-----
From: Srikanth Gubba [mailto:sgubba@lylesdata.com]
Sent: Wednesday, October 22, 2003 2:24 PM
To: 'struts-user@jakarta.apache.org'
Subject: Logic Iterate --URGENT Please


Hi all,

I have a doubt using logic iterate:

Is it possible to display a row in a different color based on a value of the
bean while iterating it?

Actually, I am displaying the tax history of a person and I want to
highlight the row or a field (tax owed) to red color if the tax paid column
shows delinquent.

Please let me know if u have any suggestions or ideas.

Thanks in Advance,
Srikanth Gubba.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org