How to make a Row Bold

Hi every one,

I am retrieving the data from the database in a list and displaying it in the home page using iterator. Here is my code

<logic:iterate id="user" name="list">

<% even = !even; %>

<tr>

<td class="trbgdark"><a href="Project_Page.do">

<bean:write name="user" property="userId" /></a>

</td>

<td class="trbgdark"><a href="Project_Page.do">

<bean:write name="user" property="firstName" /></a>

</td>

<td class="trbgdark">

<bean:write name="user" property="lastName" />

</td>

<td class="trbgdark">

<bean:write name="user" property="status" />

</td>

</tr>

</logic:iterate>

Its works fine, but my issue over here is that, here the status bean can be Active, New and Complete. I want to display the total row in bold where the status is active. How can I achieve this.

Thanks

[1440 byte] By [Sowja] at [2007-11-27 10:06:00]
# 1

You'll want to use the <nested:equal ...> tag (the usage is exactly the same as the <logic:equal ...> tag, just be sure to reference the variable you are iterating over) to check the status code, and if it's active then print out some <b> </b> tags to make the text bold.

let me know if you need further help.

den2681a at 2007-7-13 0:42:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
put the style tag on each <TD>style="font-weight: bold"
skp71a at 2007-7-13 0:42:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
> put the style tag on each <TD>> style="font-weight: bold"The OP doesn't want every row bold, only the active rows.
den2681a at 2007-7-13 0:42:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi thanks for your reply and I have never worked on nested tag till now. can you explain what I can do in a better way..I cannot understand how can I implement nested tag for this functionality.
Sowja at 2007-7-13 0:42:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
If I place the style tag how can I meet the condition i.e. status as active...I want only few rows to be Bold not all rows..
Sowja at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

here ya go...

<nested:equal name="user" property="status" equals="WHATEVER">

<b>

</nested:equal>

<bean:write name="user" property="status"/>

<nested:equal name="user" property="status" equals="WHATEVER">

</b>

</nested:equal>

if you find that doesn't work try replacing all the "nested" with "logic" and try again.

den2681a at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

If I do this only that particular value will be in bold.

I want the entire row to be Bold. So I think I have to put that condition to each and every <td> attribute and check for the condition. Is that True?

Is there any other way, because I have so many fields in the logic:iterate tag.

Sowja at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
Here its giving me an error no start tag for <b> as it is opened in <logic:equal> and </logic:equal> as the tags opened must be closed in the scope, and its only allowing me to close the <b> tag only in the first <logic:equal>
Sowja at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

Here you go Sowj!!!

<logic:iterate id="user" name="list">

<% even = !even; %>

-- starts

<logic:equal name="user" property="status" value="Active">

<tr style="font-weight:bold">

</logic:equal>

<logic:notEqual name="user" property="status" value="Active">

<tr>

</logic:notEqual>

--ends

<td class="trbgdark"><a href="Project_Page.do">

<bean:write name="user" property="userId" /></a>

</td>

<td class="trbgdark"><a href="Project_Page.do">

<bean:write name="user" property="firstName" /></a>

</td>

<td class="trbgdark">

<bean:write name="user" property="lastName" />

</td>

<td class="trbgdark">

<bean:write name="user" property="status" />

</td>

</tr>

</logic:iterate>

vinayak_ra at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
Thank you for your help. It helped me a lot.
Sowja at 2007-7-13 0:42:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...