You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Puneet Lakhina <pu...@gmail.com> on 2006/08/02 06:31:00 UTC

Runtime Expression in logic:equal

Hi,
I have a collection over which Im iterating using logic iterate tag and
inside that im creating the rows of a table. I need to color the rows of the
table alternately. I have used the attribute indexId in in the iterate tag
But i need to use some kind of runtime expression in logic:equal tag to know
even and odd rows. I could always do it with simple jsp, but if there is an
option to do it in struts it will be really useful.

i mean something like the following

<logic:iterate id = "idname" collection="mycollection" indexId="index" >
<logic:equal name="index "property "someruntime expression" "value="0">
<tr color="red"></tr>
</logic:equal>
<logic:notEqual name="index "property "someruntime expression" "value="0">
<tr color="green"></tr>
</logic:notEqual>

-- 
Puneet

Re: Runtime Expression in logic:equal

Posted by Puneet Lakhina <pu...@gmail.com>.
On 8/2/06, Chetan Pandey <cp...@bluesingapore.com> wrote:
>
> Why don't you use displaytags
> (
> http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/docs/tut_bas
> ic.html)


this thing looks fantastically easy. but alas i didnt have the time to dirty
my hands into it.Did it with plain old javascript.
THanks anyway.


-- 
Puneet

RE: Runtime Expression in logic:equal

Posted by Chetan Pandey <cp...@BLUEsingapore.com>.
Why don't you use displaytags
(http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/docs/tut_bas
ic.html)

Chetan Pandey

-----Original Message-----
From: Puneet Lakhina [mailto:puneet.lakhina@gmail.com] 
Sent: Wednesday, August 02, 2006 12:31 PM
To: Struts Users Mailing List
Subject: Runtime Expression in logic:equal

Hi,
I have a collection over which Im iterating using logic iterate tag and
inside that im creating the rows of a table. I need to color the rows of the
table alternately. I have used the attribute indexId in in the iterate tag
But i need to use some kind of runtime expression in logic:equal tag to know
even and odd rows. I could always do it with simple jsp, but if there is an
option to do it in struts it will be really useful.

i mean something like the following

<logic:iterate id = "idname" collection="mycollection" indexId="index" >
<logic:equal name="index "property "someruntime expression" "value="0">
<tr color="red"></tr>
</logic:equal>
<logic:notEqual name="index "property "someruntime expression" "value="0">
<tr color="green"></tr>
</logic:notEqual>

-- 
Puneet




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