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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:05:10+00:00 2026-05-23T08:05:10+00:00

I extend ComboBox and in constructor have such code: ModelType type = new ModelType();

  • 0

I extend ComboBox and in constructor have such code:

ModelType type = new ModelType();  
type.setRoot("data");
type.addField("id", "id");
type.addField("name", "name");

JsonLoadResultReader<ListLoadResult<ModelData>> reader = new JsonLoadResultReader<ListLoadResult<ModelData>>(type);

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "/category/getall");
HttpProxy<String> proxy = new HttpProxy<String>(builder);

BaseListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy, reader);

ListStore<ModelData> store = new ListStore<ModelData>(loader);


setStore(store);
loader.load();
setValueField("id");
setDisplayField("name");
setName("categoty");

Result: ajax query send to server but no results see in combobox but when click on it it loads data again and then display it, and how to set value to combobox?

  • 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-23T08:05:11+00:00Added an answer on May 23, 2026 at 8:05 am

    I’ve created a simple store factory method that should solve your issue.
    Copy in your class and create the store:

    setStore(_createListStore("/category/getall", "data", "id", "name"));
    loader.load();
    setValueField("id");
    setDisplayField("name");
    setName("categoty");
    

    the error in your code is that you add two fields to the ModelType, instead you should add just one field with “id” as value and “name” as display

    protected ListStore<ModelData> _createListStore(String url, String root, String fieldValue, String displayValue){
        ModelType mt = new ModelType();
        mt.setRoot(root);
        mt.addField(displayValue, fieldValue);
        RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
        HttpProxy<String> proxy = new HttpProxy<String>(rb);
        JsonLoadResultReader<ListLoadResult<ModelData>> reader = new JsonLoadResultReader<ListLoadResult<ModelData>>(mt);
        final BaseListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy, reader);
        ListStore<ModelData> store = new ListStore<ModelData>(loader);
        return store;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extend the TextBox , ComboBox and Panel controls using IExtenderProvider but
Is it possible to extend LINQ-to-SQL entity-classes with constructor-methods and in the same go;
As topic says, I need to extend the features of a standard Silverlight ComboBox
I extend upon a legacy library which accesses files on the harddrive. I have
I have a little problem. At my application Im always building two linked combobox
i am looking to extend a third party control, it is a ComboBox (so
How do i extend an existing control (ComboBox in my case) to include a
How can we extend the Alfresco database? I need to add new tables to
I have need of a checked combobox control like this one --> DevExpress (I
I have an ExtJs combobox. Its store loaded using JSON (using MyStore class below).

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.