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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:13:52+00:00 2026-05-27T05:13:52+00:00

I have CellTable with MultipleSelectionModel attached to it. After some modification of data the

  • 0

I have CellTable with MultipleSelectionModel attached to it. After some modification of data the table has to be refreshed and new data has to be reloaded from server.

However I need to update checkboxes state for newly loaded data. So I am able to query selection boxes with selectionModel.getSelectedSet() – but now I need to find these objects in table and “check” them.

Because content of objects changes and since they are used as keys in Maps internally in GWT components- I was forced to write “wrapper” over these objects which uses only ID in equals/hashCode.

So basically I save selectedSet before firing event, then iterate over it and invoke setSelected method:

Set<T> selectedSet = selectionModel.getSelectedSet();
RangeChangeEvent.fire(table,...)
if (selectedSet != null)
    for (T obj : selectedSet) {
        selectionModel.setSelected(obj,true);
    }
}

Is there any better approach?

  • 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-27T05:13:52+00:00Added an answer on May 27, 2026 at 5:13 am

    This is what the ProvidesKey is for: create a ProvidesKey instance that returns the ID of your objects to be used as their keys, and pass that instance to your selection model when you build it:

    MultiSelectionModel<X> selectionModel = new MultiSelectionModel<X>(new ProvidesKey<X>() {
       @Override
       public Object getKey(X item) {
          return item.getId();
       }
    });
    

    That way, you shouldn’t have anything special to do with your selection model after retrieving updated data: push it to your table and it’ll ask the selection model for each object whether it’s selected or not, and the selection model will be able to answer based solely on the object’s ID, therefore reusing the same selected set as before.

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

Sidebar

Related Questions

I have a cell table that has several columns whose data may occasionally be
I have this button cell in my CellTable ButtonCell reListCell = new ButtonCell(); reListColumn
I have two tables. Table A has a list of employee names. Table B
I have a tableview which is being reloaded as new content is added, using
I have a GWT CellTable<MyType> . This table have rows which should display a
i have small problem i.e. their is one celltable with lot of data it
I have a little piece of code which populates a CellTable from a Type
I have a rather peculiar problem. I am using CellTable from GWT 2.2 release.
Writing GWT application. I have CellTable and a code that i'v got from google-example
i'm a newbie here and in GWT. Well, i have some questions with CellTable...

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.