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.
# 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.
# 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 >

# 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>