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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:30:49+00:00 2026-05-27T23:30:49+00:00

I recently created a flextable using GWT 2.4 using this code: @uiBinder Flextable flextable;

  • 0

I recently created a flextable using GWT 2.4 using this code:

@uiBinder Flextable flextable;

In the constructor I call setupFlexTable() after I do

initWidget(uiBinder.createAndBindUi(this));

and then the flexTable is instantiated. I missed that part. Using setText() works.

 //Header row
    private void setupFlexTable() {
            flexTable.setText(0, 0, "Label One");
            flexTable.setText(0, 1, "Label Two");
    }

setWidget didn’t display, but this is what I used:

int numRows = flexTable.getRowCount();
        flexTable.setWidget(numRows, 0, new Label("Label One"));
        flexTable.setWidget(numRows, 1, new Label("Label Two"));
        flexTable.getFlexCellFormatter().setRowSpan(0, 1, numRows + 1);

Here is where I add rows in and this code works with setWidget():

@Override
    public void setRowData(Data data) {
        int rowCount = flexTable.getRowCount() + 1;
        flexTable.setWidget((rowCount), 0, new Label(data.getDataName()));
        flexTable.getFlexCellFormatter().setRowSpan(rowCount, 0, 2);
        flexTable.setWidget((rowCount), 1, new Label(data.getData()));
        flexTable.getFlexCellFormatter().setRowSpan(rowCount, 1, 2);
    }

Also, when I use flexTable.setText(“Label One”); etc… it displays, but when I use setWidget(), it does not?

Another issue is I need to keep this table in sync with a list of files above it, but using Firebug I see that if I add two rows dynamically to the table, it shows a rowCount of 4? This throws an index out of bounds error when I try to remove a row and it reaches one of these blank rows.

As a work-around, I use this code to find the row I need to delete and avoid the issue with the blank rows (apparently there are two and only two blank rows inserted in the table).

int rows = flexTable.getRowCount(); 

        for(int i=0; i < rows; i++){
//Match the text in the first field in order to know the proper row to delete.
            if(flexTable.isCellPresent(i,0) && flexTable.getText(i, 0).equalsIgnoreCase(fileName)){
                flexTable.removeRow(i);
                break;
            }
        }

So can anyone explain why setWidget() doesn’t display anything and why I’m getting an extra blank row for each one I add?

  • 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-27T23:30:50+00:00Added an answer on May 27, 2026 at 11:30 pm

    You should not instantiate the FlexTable in your code – GWT does that for you. Once you make a new FlexTable you’re working on a new object, NOT the one included in your widget. In the code you’ve posted you have one variable called flextable and another called flexTable – it’s easy to imagine some confusion happening.

    I think your other problems may become more clear once you have this set up properly.

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

Sidebar

Related Questions

I have recently created a new rails 3 application, using the code that I
I recently created a class which has a constructor taking 3 enumerations as arguments.
I recently created a ajax based instant messaging application and after running for a
I've recently created these two (unrelated) methods to replace lots of boiler-plate code in
I have recently created a web project in Java using eclipse. I have a
We recently created a branch out of the main branch of our code for
I recently created a couple inline table-valued UDF's and then referenced them in a
I want to select recently created element doing something like this: $(body).append(<div id='popup.dialog'></div>); dialogDiv
The code below returns the top 25 most recently-created tables in a MySQL database.
I recently created a ListView using ListAdapter and applied a static background image behind

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.