Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8330443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:07:28+00:00 2026-06-09T02:07:28+00:00

I have a primefaces datatable and inside the primefaces datatable, I have a column,

  • 0

I have a primefaces datatable and inside the primefaces datatable, I have a column, which contains the . The issue is,I have set the default value for the as false. When I click/check the , its still retrieving the value as false. I tried it multiple times but not sure why its returning false. Please find the sample code below.

  <p:dataTable  id="review-table" var="item" value="#{demandBean.filterVOList}">
  <p:column id="SelectallID" style="text-align: left; width:40px;" rendered="#{demandBean.screeRenderVo.selectAllRenderer}">
 <f:facet name="header" >
  <h:outputText id="selectId"  value="#{demandBean.dmdScreenLabelVO.selectAll}" />
                    <div></div>
<h:selectBooleanCheckbox id="checkbox1" value="Select All" onclick="checkAll(this)"/>
</f:facet>
<h:selectBooleanCheckbox id="checkbox2"  value="#{item.selected}"/>
</p:column>

Im getting the value as false, when I check the and click on the save button. I have written an Action listerner, below is the code corresponding to the actionListener

public void saveData(ActionEvent event)
{
    System.out.println("Entering the Save :");
    selected = isSelected();
    System.out.println("value of Selected"+selected);
}

I have tried debugging the code as well, but not sure why the value for is getting displayed as false. Please Assist. Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:07:29+00:00Added an answer on June 9, 2026 at 2:07 am

    You seem to be binding the value of all checkboxes in the column to the one and same bean property. This way the value will ultimately end up to be the one of the last row in the column.

    This is not how it’s supposed to be used.

    You basically need to bind the value of the checkbox to the property of the currently iterated row object (the one behind the var attribute of the datatable).

    <p:dataTable value="#{bean.items}" var="item">
        <p:column>
            <p:selectBooleanCheckbox value="#{item.selected}" />
    

    Alternatively, you could use the <p:column selectionMode="multiple" /> to use builtin multiple selection support of the PrimeFaces datatable (see also the showcase example).

    <p:dataTable value="#{bean.items}" var="item" rowKey="#{item.id}" selection="#{bean.selectedItems}">
        <p:column selectionMode="multiple" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Primefaces 3.3.1 and have question. I have p:commandButton inside p:column of p:dataTable.
I'm using primefaces' accordion panel. Inside the tabs i have forms which are created
I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value=#{myBean.profileNotifications} var=item rendered=#{myBean.renderProfileNotification}> <h:column>
I have a primefaces datatable: <p:dataTable id=idCrawledDataTable var=crawledData value=#{crawlerCorpusTreatmentBean.crawledDataModel} rowKey=#{crawledData.id} rows=10 scrollable=true scrollHeight=300 selection=#{crawlerCorpusTreatmentBean.crawledData}
I'm using Primefaces 3.3.1 with Tomcat 7.0.22.0. I have p:dataTable which has p:inputText in
I have a question about updating variable inside dataTable component, which was sended to
I have an application that contains commandLinks within a Primefaces dataTable. The commandLinks link
i have this simple page: <h:form id=form> <p:dataTable value=#{testBean.unitTypeModel} var=elem lazy=true rows=10> <p:column headerText=class>#{elem.class.simpleName}</p:column>
I have primefaces datatable, <p:panel id=resultpanel> <p:dataTable id=tbl var=job value=#{report.jobModel} paginator=true rows=#{report.jobModel.pageSize} paginatorPosition=bottom lazy=true
I have a question regarding primefaces datatable component. I want to bind a DataTable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.