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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:58:54+00:00 2026-05-22T15:58:54+00:00

I have a GWT CellTable<MyType> . This table have rows which should display a

  • 0

I have a GWT CellTable<MyType>. This table have rows which should display a CheckBox. This CheckBox should checked or unchecked depending on a getter in MyType, but it should disabled so the user can’t click it. Does anybody know how this could be implemented?

Some code snippets:

Column<MyType, Boolean> checkboxColumn = new Column<MyType, Boolean>(new CheckboxCell()) {
    @Override
    public Boolean getValue(MyType object) {
        return object.isItTrue();
    }
};
CellTable<MyType> cellTable = new CellTable<MyType>();
cellTable.addColumn(checkboxColumn, "Header title");
  • 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-05-22T15:58:55+00:00Added an answer on May 22, 2026 at 3:58 pm

    CheckboxCell does not support this functionality, but you can make your own cell that does. Untested code (copied largely from the CheckboxCell code, Copyright Google (see CheckboxCell source for license)) follows! The important part is in the render code. Your new cell would go in a Column<MyType, MyType>.

    public class DisableableCheckboxCell extends AbstractEditableCell<MyType> {
    
      /**
       * An html string representation of a checked input box.
       */
      private static final SafeHtml INPUT_CHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" checked/>");
    
      /**
       * An html string representation of an unchecked input box.
       */
      private static final SafeHtml INPUT_UNCHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\"/>");
    
      private static final SafeHtml INPUT_CHECKED_DISABLED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" checked disabled=\"disabled\"/>");
    
      private static final SafeHtml INPUT_UNCHECKED_DISABLED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" disabled=\"disabled\"/>");
    
    /** You'd copy the rest of the code from CheckboxCell, or implement the other required functions yourself **/
    
      @Override
      public void render(Context context, MyType value, SafeHtmlBuilder sb) {
        // Get the view data.
        Object key = context.getKey();
        MyType viewData = getViewData(key);
        if (viewData != null && viewData.equals(value)) {
          clearViewData(key);
          viewData = null;
        }
    
        MyType relevantValue = viewData != null ? viewData : value;
        boolean checked = relevantValue.shouldBeChecked();
        boolean enabled = relevantValue.shouldBeEnabled();
    
        if (checked && !enabled)) {
          sb.append(INPUT_CHECKED_DISABLED);
        } else if (!checked && !enabled) {
          sb.append(INPUT_UNCHECKED_DISABLED);
        } else if (checked && enabled) {
          sb.append(INPUT_CHECKED);
        } else if (!checked && enabled) {
          sb.append(INPUT_UNCHECKED);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GWT application for which I'm trying to write some tests using
I have a GWT project in which I need to manually specify currency, number
We have a gwt-client, which recieves quite a lot of data from our servers.
Have you tried using MVC or any other UI pattern for GWT client code.
I was looking into GWT. It seems nice, but our software have the must
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you managed to get Aptana Studio debugging to work? I tried following this,
Anyone have GWT 1.6.4 running on FreeBSD? Our build server is a FreeBSD box,
Does gwt have (good) support for effects, moving around elements, and resizing them? Are
I have a GWT application that displays some charts rendered by JFreeChart. Every few

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.