• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem using varStatus and c:when

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Btw, if you click the 'disable smiles' checkbox when posting, your tags will look less surprised.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic