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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:16:40+00:00 2026-05-26T19:16:40+00:00

could someone help me. I’m new to gwt and maybe this is so simple.

  • 0

could someone help me. I’m new to gwt and maybe this is so simple. but I can’t seem to figure this out…
I create 2 button for a row in a celltable, each with this method:

protected void addButtonColumn(String header, final IHasValue<Row, Button> hasVal){
    Column<Row, String> column = new Column<Row, String>(new TextButtonCell()) {
        @Override
        public String getValue(Row object) {
            return ((Button)hasVal.getValue(object)).getText();
        }
    };
    column.setFieldUpdater(new FieldUpdater<Row, String>() {
        @Override
        public void update(int index, Row object, String value) {
            ((Button) hasVal.getValue(object)).click();
        }
    });
    table.addColumn(column, header);
}

I want each button to something different when clicked, but it doesn’t work. i know that i should do something in setfieldupdater but i don’t know what.

  • 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-26T19:16:41+00:00Added an answer on May 26, 2026 at 7:16 pm

    Your use of the TextButtonCell to contain a Button (i.e. a widget) doesn’t really make a lot of sense – wouldn’t it be easier to let the cell have access to the data, and use the ValueUpdater to trigger some kind of behavior based on that data directly?

    Cells are not widgets – they are much simpler than widgets. This chiefly means two things: they are faster to draw, and stupider. Both of these things are as a result of a single cell instance being used to draw many pieces of data in slightly different ways. If you are going the effort of building a button per element, it doesn’t make sense to use a cell-based widget then – you are nearly drawing everything twice, and getting the worst of both worlds (slow code, that is hard to work with).

    Don’t use a Button with ClickHandlers attached, but some other abstraction to deal with clicks, like a Command instance for each row, or even better, some kind of handler that accepts the row instance clicked. It might even make sense to have a FieldUpdater instance passed in as a parameter for your method (and maybe make the IHasValue generic on String instead of Button, so your models don’t need to wrap widgets).

    (This may not be answering your question directly, but is instead hopefully helping shed some light on why we use cells at all, and how to best write code that takes advantage of cells.)

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

Sidebar

Related Questions

Could someone help me with this issue. I'm trying to figure out how to
Could someone help me figure out what this C++ code does I got it
Could someone help me on this, I have created simple web services using axis2
Could someone help me out? it's probably something simple i'm overlooking: <script src=http://jqueryui.com/ui/jquery.ui.core.js></script> <script
Could someone help me figure out how to get the hslide value in Flash
Hi could someone help me out with this jQuery? I have: $(document).ready(function () {
Could someone help me understand why this link works perfectly in firefox but in
could someone help me to figure out if it is possible to take part
Hi could someone help me figure out how to stop a function running until
How can I solve this riddle programmatically? Could someone help me with some pseudo-code

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.