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 8632611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:22:35+00:00 2026-06-12T09:22:35+00:00

Can someone explain if JSF can rerender a disabled data table on click of

  • 0

Can someone explain if JSF can rerender a disabled data table on click of a check-box?

  • 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-12T09:22:36+00:00Added an answer on June 12, 2026 at 9:22 am

    You can do it with an ajax Listener

    What you need is a boolean value to know if the table is disabled(see boolean disabled in managed bean)

    next is a method that will change this boolean whenever it is called(see selectBooleanCheckbox and rendered="#{tableController.disabled}" in xhtml)

    this can be applied to any boolean value like disabled/rendered etc.


    Source code (xhtml):

    <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
    
        <h:form>
            <h:dataTable id="table" value="#{tableController.products}" var="item" border="1" rendered="#{tableController.disabled}"
                         headerClass="table-header"
                         styleClass="table-d"
                         rowClasses="table-row">
    
                <h:column>
                    <f:facet name="header">
                        ID
                    </f:facet>
                    <h:outputText value="#{item.id}"/>
                </h:column>
    
                <h:column>
                    <f:facet name="header">
                        Name
                    </f:facet>
                    <h:outputText value="#{item.name}"/>
                </h:column>
    
                <h:column>
                    <f:facet name="header">
                        Price
                    </f:facet>
                    <h:outputText value="#{item.price}"/>
                </h:column>
    
            </h:dataTable>
    
    
            <h:selectBooleanCheckbox value="Id">
                <f:ajax render="@form" listener="#{tableController.enableDisable()}"/>
            </h:selectBooleanCheckbox>
        </h:form>
    </h:body>
    </html>
    

    Managed Bean:

    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    
    @ManagedBean
    @SessionScoped
    public class TableController {
    
    private boolean disabled;
    private DataModel products;
    
    public TableController() {
    
        List list = new ArrayList<Product>();
    
        Product p1 = new Product(1, "Z", 1.1);
        Product p2 = new Product(2, "F", 2.5);
        Product p3 = new Product(3, "A", 0.9);
    
        list.add(p1);
        list.add(p2);
        list.add(p3);
    
        products = new ListDataModel<Product>(list);
    }
    
    
     public void enableDisable(){
            disabled = !disabled;  
    }
    
    public boolean isDisabled() {
        return disabled;
    }
    
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
    
    public DataModel getProducts() {
        return products;
    }
    
    public void setProducts(DataModel products) {
        this.products = products;
    }    
    }
    

    Product Class:

    public class Product {
    
    private int id;
    private String name;
    private double price;
    
    
    public Product(int id, String name, double price){
    
        this.id = id;
        this.name = name;
        this.price = price;
    
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public void setPrice(double price) {
        this.price = price;
    }
    
    public int getId() {
        return id;
    }
    
    public double getPrice() {
        return price;
    }
    
    public String getName() {
        return name;
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone explain this JS LINE ? data is an object. var list =
Hopefully someone can explain some behavior to me. I have a JSF page with
Can someone who is an active JSF (or Primefaces) user explain why by default
Can someone explain me how below query will work.. i have table called employee
Can someone explain the mechanics of a jump table and why is would be
Can someone explain what this means? int (*data[2])[2];
Can someone explain this simple, yet deceiving, anomaly? There are two models, where B
Can someone explain me why this works: select val1, val2, count(case when table2.someID in
Can someone explain why, in this situation, scandir is getting my directory, but the
Can someone explain step by step how this query is processed? SELECT F.ID, F.FirstName,

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.