| Author |
Problem using varStatus and c:when
|
Zoe Zhao
Greenhorn
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}"> <tr> <c:forEach var="column" items="${row}" varStatus="loopStatus"> <c:choose> <c:when test="loopStatus.index==1"> <td><% radio(pageContext, "bpid", "${column}", false); %>"${loopStatus.index}"</td> <td> <c ut value="${column}"/> </td> </c:when> <c therwise> <td> <c ut value="${column}"/> </td> </c therwise> </c:choose> </c:forEach> </tr> </c:forEach> 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
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
Btw, if you click the 'disable smiles' checkbox when posting, your tags will look less surprised.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Problem using varStatus and c:when
|
|
|