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

  • SEARCH
  • Home
  • 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 7995843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:32:36+00:00 2026-06-04T14:32:36+00:00

I have a datatable with dynamicly generated data from a database. The user is

  • 0

I have a datatable with dynamicly generated data from a database. The user is able to select/unselect rows but only these which are not set as mustSelect from the database.

My Bean

        public boolean isDisabled () {
    if (evState == EvaluationState.MUST_EVALUATE) {
        return true;
    } else {
        return false;
    }
}

public boolean isChecked() {
    if (evState == EvaluationState.EVALUATE
            || evState == EvaluationState.MUST_EVALUATE) {
        return true;
    } else {
        return false;

    }
}

and my xhtmlCode:

< p:selectBooleanCheckbox value=”#{myBean.checked}” disabled = “#{myBean.disabled }”/>

which is currently not working like I want it. All check boxes are selected. At compile time I don´t know which check box will enabled or not that’s why I have the method disabled.

I would be very happy if someone has a solution how to set disabled dynamically.

  • 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-04T14:32:38+00:00Added an answer on June 4, 2026 at 2:32 pm

    Your model should contain 2 attributes to handle these operations, not your controller.

    //defining the model
    public class Data {
        private String name;
        //you get the idea...
        private boolean checked;
        private boolean disabled;
        //getters and setters...
    }
    
    //defining the controller
    @ViewScope
    public class MyBean {
        private List<Data> lstData;
    
        public MyBean() {
            //initialize data...
        }
    
        //getter and setter
    }
    

    The view

    <h:dataTable value="#{myBean.lstData}" var="data">
        <h:column>
            <h:outputText value="#{data.name}" />
        </h:column>
        <h:column>
            <p:selectBooleanCheckbox value="#{data.checked}" disabled = "#{data.disabled }"/>
        </h:column>
    </h>dataTable>
    

    in that way, every row has its own checked and disabled data value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable which I select from database (Well, these data cross several
In C#/ASP.NET 3.5, I have a DataTable which pulls rows from the database. I
Say i have a DataTable object with data from the database, and I need
I have datatable with column name tag and 100 rows of data.I need to
I have a DataTable populated with values from a database. I have another datatable
I have two Data Tables and these are completely dynamic. These would be generated
I have a datatable which has been dynamically generated from FoxPro tables using a
I have a dynamic datatable, created from a database. I want to add a
I have a DataTable that I manually created and loaded with data using C#.
I have a DataTable as a data source of a GridView. I'm adding a

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.