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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:46:06+00:00 2026-05-21T08:46:06+00:00

I am trying to figure out how to use GWT Editor when my model

  • 0

I am trying to figure out how to use GWT Editor when my model has a field that is a Set, List, etc.

I have this entity proxy:

public interface MyModel {
  void setSomeCollection(Set<String> c);
  Set<String> getSomeCollection();
}

Here is my multiselect field. I am extending ListBox so that I can change some of its behavior later.

public class DualListBox extends ListBox implements LeafValueEditor<Set<String>> {

    public DualListBox() {
        super(true);
    }

    @Override
    public void setValue(Set<String> values) {
        if (values == null) {
            return;
        }

        for (String value : values) {
            for (int i = 0; i < getItemCount(); i++) {
                if (getValue(i).equals(value)) {
                    setItemSelected(i, true);
                } else {
                    setItemSelected(i, false);
                }
            }
        }
    }

    @Override
    public Set<String> getValue() {
        Set<String> values = new HashSet<String>();
        for (int i = 0; i < getItemCount(); i++) {
            if (isItemSelected(i)) {
                values.add(getValue(i));
            }
        }

        // Debug shows that the set of values is populated correctly..
        return values;
    }
}

Basically I just cant figure out how to get fields with a Set (I have tried List as well) to work with GWTs Editor framework. Debugging so far shows that the values are coming out of the editor correctly.

I have looked at ListEditor but that looks like its used to edit a list of more complex that object types; not a single field with multiple possible values. I am implementing the wrong editor type? Is GWT Editor not able to handle fields that are collections yet?

  • 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-21T08:46:07+00:00Added an answer on May 21, 2026 at 8:46 am

    Ooops! The code I have will work correctly. I simplified my actual scenario a bit and I ended up finding my error. My real entity proxy looked more like:

    public interface MyModel {
      // BrokerType is an enum
      void setBrokerTypes(Set<BrokerType> brokerTypes);
      Set<BrokerType> getBrokerTypes();
    }
    

    ListBox always returns values as Strings! So the editor framework was probably having a hard time figuring out how to convert Set<String> to Set<BrokerType>. Would have rather seen an error instead of silent failure, but oh well.

    This is the reason I was extending ListBox in the first place (to handle more complex types) so I guess I need to get that working before expecting the Editor framework to know what to do with the Set.

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

Sidebar

Related Questions

I am trying to figure out how to use the ProfileProvider that's in this
I am trying to figure out how to use this pushstate and popstate for
Trying to figure out how to use EventToCommand to set a datagrid double click
Im trying to figure out how to use a column from another model in
I'm trying to figure out how to use this function. I found it on
I am trying to figure out how to use mongoose-joins for Node.js. I have
I'm trying to figure out how to use dynamic variables for my methods that
I have been trying to figure out how to use the Routing features with
Trying to figure out which to use.
I'm trying to figure out how to use Emacs Code Browser (ECB) and one

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.