Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selectBooleanCheckbox

 
Yellapa Adepu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I have a table to display with multiple rows. I am using selectBooleanCheckbox to display a check box as a first column of each row. My requirement is I need to capture the details of selected row say e.g row ID. It is displaying a check box for each row, but I am not sure how capture the selected rows in backing bean. Any help would be appreciated.
<t:dataTable id="list" value="#{ActionBean.cmplList}" var="srchlist" width="100%">
<t:column>
<h:selectBooleanCheckbox binding="#{ActionBean.checkBox}" value="#{srchlist.rowId}"/>
</t:column>
<t:column>
<f:facet name="header">
<hutputText value="Row#"/>
</f:facet>
<hutputText value="#{srchlist.rowId}"/>
</t:column>
<t:column>
<f:facet name="header">
<hutputText value="Project Name"/>
</f:facet>
<hutputText value="#{srchlist.ProjNm}"/>
</t:column>
<t:column>
<f:facet name="header">
<hutputText value="County/>
</f:facet>
<hutputText value="#{County[srchlist.cntyId]}"/>
</t:column>
</t:dataTable>

Thanks
Adepu
[ September 28, 2006: Message edited by: Adepu ]
 
Sajan Patel
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I am guessing very wild here but
Can you use try following




And in Your Handler class



So whenever someone click that Check box you will get request in your handler.
Problem with is that page will execute each time someone click that check box.
I hope this help you
 
Yellapa Adepu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry dude.. I tried but some how the listener method is not being called.. any idea???
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch Adepu

We don't have too many rules around here but we do have a Naming Policy. Please adjust your display name accordingly. You can do so by clicking here.

This is not a suggestion. This is a requirement.

Thanks a bunch.
[ September 28, 2006: Message edited by: Gregg Bolinger ]
 
Sajan Patel
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After changing name. Could you show your full JSP and Handler. And yeah dont make dumb mistake by not putting code inside <h:form
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see http://www.coderanch.com/t/212177/JSF/java/RADIO-BUTTON-ROW-DATA-TABLE
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic