Sorry BpMurray, I was off for few days :)
Repeater works great. thank you.
Main Topics
Browse All TopicsDear Experts,
I have jsf DataTable and checkbox problem
I have a List listCountries with fields: countryId & countryNm
<h:dataTable value="#{pLM0001.listCount
var="f0001"
binding="#{pLM0001.htmlDat
border="1">
<h:column>
<h:outputText value="#{f0001.countryid}"
</h:column>
<h:column>
<h:outputText value="#{f0001.countryNm}"
</h:column>
<h:column>
<h:selectBooleanCheckbox value="#{pLM0001.bolSelect
</h:selectBooleanCheckbox>
</h:column>
</h:dataTable>
End users can pick the countries they want to select.
The problem is, how can I get which countries are selected?
I am still a rookie in jsf and java environment, please kindly help :).
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: bpmurrayPosted on 2007-04-27 at 12:25:58ID: 18991641
Well, it depends on your bean, etc. and you haven't provided a lot of information. However the general solution is that you have to get hold of the underlying UIData object that your table depends on. The easiest place to handle this is in your backing bean, where you can process the selected items. So you might have something like:
ws);
public void button1ClickAction() {
int iX = myUiData.getFirst(); // Get the first record in the current page in the table
int rows = myUiData.getRows(); // Get the size of the displayed data table
// Search the table
for (; iX< rows; iX++) {
// Start at first row displayed
myUiData.setRowIndex(iX+ro
// Get the bolSelected value for this item
}
}
You might like to look at the Repeater example in the JSF downloads for examples on how to use the UIData objects.