This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JSP and the fly likes Problem using varStatus and c:when Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem using varStatus and c:when" Watch "Problem using varStatus and c:when" New topic

Problem using varStatus and c:when

Zoe Zhao

Joined: Mar 30, 2005
Posts: 4
Beginner's question: I need to show my database query result in a table, say it's 4 columns and 10 rows. Need to render it as 10 rows * 5 columns, with the 1st column a set of radio buttons so the user can pick up a row by clicking the radio button. 2nd column is the ID, so i wish to set the value of the radio button to be the value of the 2nd ID column, for each row.

Hers is my code:

<c:forEach var="row" items="${rs.rowsByIndex}">
<c:forEach var="column" items="${row}" varStatus="loopStatus">

<c:when test="loopStatus.index==1">
<td><% radio(pageContext, "bpid", "${column}", false); %>"${loopStatus.index}"</td>
<td> <c ut value="${column}"/> </td>
<c therwise>
<td> <c ut value="${column}"/> </td>
</c therwise>



What I see is that the radio button did't get painted, which means the c:when condition never returns true. I guess i didn't use the varStatus in the right way.

Anybody could kindly help me out here? Thank you so much!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Btw, if you click the 'disable smiles' checkbox when posting, your tags will look less surprised.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Problem using varStatus and c:when
It's not a secret anymore!