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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:26:26+00:00 2026-05-31T23:26:26+00:00

I followed the instructions: create the bean. This bean is for an enum transferred

  • 0

I followed the instructions:

  1. create the bean. This bean is for an enum transferred from server to client using RestyGWT.

    public enum Mode{
      MODIFY,
      EDIT,
      DELETE,
      CREATE
    }
    
  2. Define the marker on the bean.

    @BEAN(Mode.class)
    static public class ModelMarker implements BeanModelMarker { }
    
  3. (Paraphrasing a statement from GXT blog) Now use your BeanModelMarker on any data component.

    So, I created a combo box.

    static private ComboBox<ModelMarker> propertyTypeComboBox =
      new ComboBox<ModelMarker>();
    

    Ooops, the ComboBox does not accept BeanModelMarker as a Model type. And it certainly is wrong, because it has not been GWT created yet.

And so what do I do with a GWT created instance?

static ModelMarker beanModel =
  GWT.create(ModelMarker.class);

I am unable to find any literature that tells me explicitly what to do with a BeanModelMarker after it is defined. How do I use it?

I would like to know what I need to do to define a Bean or Base Model, so that I could use the enum in my data-driven combobox.

Am I asking the question in the right way about BeanModelMarker? Is it relevant to my attempt at creating an enum-driven combo box?

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

    Couple of thoughts:

    Here is a discussion on the GXT forums about wrapping enum types in ComboBoxes. http://www.sencha.com/forum/showthread.php?67317-Enum-based-ComboBox. Several approaches are used – in that thread, I went with the approach of making an EnumWrapper, and some static convenience methods to create List<EnumWrapper<MyEnum>> collections to give to the combo box ListStore. One of the main reasons that I went for that as opposed to a BeanModel approach was that I needed my enums to be i18n-capable, and didn’t want that i18n logic in the enum itself.

    More pertinent to your question, the correct way to translate a java object to a BeanModel is to use the BeanModelFactory instance provided from BeanModelLookup.getFactory(Mode.class). ModelMarker is just an interface, and can’t implement ModelData, so your ComboBox<ModelMarker> declaration doesn’t really make sense. Remember that using this approach means your Mode enum needs to expose getters so the BeanModel generation code can work its reflection-ish magic (like in http://www.sencha.com/forum/showthread.php?67317-Enum-based-ComboBox&p=332996&viewfull=1#post332996).

    ComboBox<BeanModel> modeCombo = new ComboBox<BeanModel>();
    ListStore<BeanModel> store = new ListStore<BeanModel>();
    
    // this next line might need ModelMarker.class instead, its been a while
    BeanModelFactory modeFactory = BeanModelLookup.get().getFactory(Mode.class);
    
    
    // either add items one at a time
    Mode mode = Mode.EDIT;
    store.add(modeFactory.createModel(mode));
    
    // or add a collection
    store.add(modeFactory.createModel(Arrays.asList(Mode.values()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've followed instructions from this question on SO to set up RVM, rubies and
I have followed the instructions from this SO question: How to change the text
I've followed the instructions from TestFlight to duplicate the release configuration. Also I'm using
I followed the instructions in this thread to create a daily alarm that starts
I followed these instructions from GitHub web page to create a first repo; Global
I've followed the instructions in this MSDN article: http://msdn.microsoft.com/en-us/library/dd206945.aspx Is it possible to call
I've followed the instructions from http://www.lucidimagination.com/blog/2009/03/09/nutch-solr/ Had solr up and running before that, could
I just started learning targets, and have followed all the instructions to create my
I followed the instructions here on how to create an Android library project, and
I want to change XAMPP's htdocs directory. I followed the instructions to create a

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.