File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using varStatus and c:when

 
Zoe Zhao
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Btw, if you click the 'disable smiles' checkbox when posting, your tags will look less surprised.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic