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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:12+00:00 2026-05-26T11:06:12+00:00

Is there a way to add a clickHandler to a Column in a cellTable

  • 0

Is there a way to add a clickHandler to a Column in a cellTable in GWT ??

I do not see any option from the documentation for TextColumn.

My requirement goes this way – I have to display 5 columns of data in a cell table and one of the columns must have a onClick event to be fired. But I found no way to add a clickhandler to the textColumn.

if this was supposed to be done in regular html it would not take me 5 seconds to write the code –

  • 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-26T11:06:13+00:00Added an answer on May 26, 2026 at 11:06 am

    Write your custom cell (here an example I wrote based on GWT ActionCell) :

    public abstract class ActionTextCell<C> extends AbstractCell<C> {
    
      public static interface Delegate<T> {
        void execute(T object);
      }
    
      private final Delegate<C> delegate;
    
      public ActionTextCell(Delegate<C> delegate) {
        super("click", "keydown");
        this.delegate = delegate;
      }
    
      @Override
      protected void onEnterKeyDown(Context context, Element parent, C value, NativeEvent event,
          ValueUpdater<C> valueUpdater) {
        delegate.execute(value);
      }
    
      @Override
      public void onBrowserEvent(Context context, Element parent, C value, NativeEvent event, ValueUpdater<C> valueUpdater) {
        super.onBrowserEvent(context, parent, value, event, valueUpdater);
        if ("click".equals(event.getType())) {
          onEnterKeyDown(context, parent, value, event, valueUpdater);
        }
      }
    
      @Override
      public void render(Context context, C value, SafeHtmlBuilder sb) {
        sb.append(new SafeHtmlBuilder().appendHtmlConstant("<span>" + render(value) + "</span>")
          .toSafeHtml());
      }
    
      public abstract String render(C value);
    
    }
    

    And use it within an IndentityColumn which you add to your CellTable:

    final ActionTextCell<MyClass> cell = new ActionTextCell<MyClass>(new ActionTextCell.Delegate<MyClass>() {
    
          @Override
          public void execute(MyClass c) {
            // do something with c
          }
        }) {
    
          @Override
          public String render(MyClass c) {
            // return a string representation of c
          }
        };
    
    final IdentityColumn<MyClass> column = new IdentityColumn<MyClass>(cell);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to add a not null type column to a Postgresql
I am using gwt-visualisation chart But is there any way to add click handler
Is there any way to add funds to my PP account from associated bank
Is there a way to add a resource to a ResourceDictionary from code without
Is there any way to add a field to a class at runtime (
Is there any way to add a SQL Server Database Diagram to source control?
Is there any way to add validation (ie SSN) to a SharePoint field and
Is there any way to add clickHandlers (or any type of handler) to the
Is there any way to add an item to the Windows Explorer context menu
Is there way to add new method to List object over the object from

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.