File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes how to set and get h:selectBooleanCheckbox value in h:datatabel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to set and get h:selectBooleanCheckbox value in h:datatabel" Watch "how to set and get h:selectBooleanCheckbox value in h:datatabel" New topic

how to set and get h:selectBooleanCheckbox value in h:datatabel


Joined: Sep 26, 2007
Posts: 7
hello friends,

Please help me any one...i need urgent.........................
My jsf page:
<h:panelGrid columns="6">
<h:dataTable border="2" value="#{planGroup.screenFlowValues}" var="result" bgcolor="#F1F1F1" cellpadding="2" cellspacing="1">
<h:column id="col1">
<f:facet name="header">
<hutputLabel id="lblchange" value="Select" />
<h:selectBooleanCheckbox id="chkid" value="#{planGroup.chkValue}">
<h:column id="column1">
<f:facet name="header">
<hutputText value="Plan Group ID"></hutputText>
<hutputText value="#{result.planGroupId}"></hutputText>
<h:inputHidden id="planGroupList" value="#{result.planGroupId}" />
<h:column id="column2">
<f:facet name="header">
<hutputText value="Plan ID"></hutputText>
<hutputText value="#{result.planId}" converter="plantext"></hutputText>
<h:column id="column3">
<f:facet name="header">
<hutputText value="Group Description"></hutputText>
<hutputText value="#{result.groupDesc}"></hutputText>
<h:column id="column4">
<f:facet name="header">
<hutputText value="Row Status"></hutputText>
<hutputText value="#{result.rowStatus}"></hutputText>
<h:column id="column5">
<f:facet name="header">
<hutputText value="Modifiy"></hutputText>
<h:commandLink id="link1" value="Edit" action="#{planGroup.ModifiyMemberrecord}" immediate="true"/>

Here in this jsf page.......
1.value="#{planGroup.screenFlowValues}"--is Datamodel
2.For me page is displaying.How to set value to the check box and multiple selection of checkbox..when i click delete button ,
i have to delete selected rows from to do that what are all the changes i have to.Because boolean checkbox return only true false value. using h:datatabel i can do that ya..

My bean:
public class PlanGroupBean {
private String planGroupID;
private String planID;
private String groupDesc;
private String rowStatus;
private static Log log = LogFactory.getLog(PlanGroup.class);
private static DataModel screenFlowValues;
private String hideWindows;
private String hiddenValue;
private boolean chkValue;

public List getProdlis() {
return prodlis;

public void setProdlis(List prodlis) {
this.prodlis = prodlis;
public List getData() {
return data;

public void setData(List data) { = data;

public boolean isChkValue() {
return chkValue;

public void setChkValue(boolean chkValue) {

this.chkValue = chkValue;

public void setPlanGroupID(String planGroupID) {
this.planGroupID = planGroupID;

public String getPlanGroupID() {
return this.planGroupID;

public void setPlanID(String planID) {
this.planID = planID;

public String getPlanID() {
return this.planID;

public void setGroupDesc(String groupDesc) {

this.groupDesc = groupDesc;

public String getGroupDesc() {
return this.groupDesc;

public void setRowStatus(String rowStatus) {
this.rowStatus = rowStatus;

public String getRowStatus() {
return this.rowStatus;
public String getHiddenValue() {
screenFlowValues = new ListDataModel(ServiceDao.execute().fetchPlanGroupDisp());
return hiddenValue;

public void setHiddenValue(String hiddenValue) {
this.hiddenValue = hiddenValue;
public void setHideWindows(String hideWindows) {
this.hideWindows = hideWindows;


public String getHideWindows() {
return this.hideWindows;
public DataModel getScreenFlowValues() {
return screenFlowValues;
public void setScreenFlowValues(DataModel screenFlowValues) {
PlanGroupBean.screenFlowValues = screenFlowValues;

public String deleteMemberrecord()
please help me how to set value to the check box and while clicking delete button i have to know what are all the checkbox selected..........

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

"ssjava", please check your private messages.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: how to set and get h:selectBooleanCheckbox value in h:datatabel
jQuery in Action, 3rd edition