1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    7
    Vote Rating
    0
    crowolf is on a distinguished road

      0  

    Default Combobox not loading json response

    Hello,
    I'm having some trouble with the ComboBox. My response from the server is valid and looks okay when going to the url with a browser. The ComboBox is stuck on 'Loading...' however.

    This is the code of the view:
    Code:
    String url = "/SDIQueryServlet?ns=[%22NCBI Taxonomy%22]";
        ScriptTagProxy<PagingLoadResult<ModelData>> proxy = new ScriptTagProxy<PagingLoadResult<ModelData>>(url);
    
        ModelType type = new ModelType();
        type.setRoot("terms");
        type.addField("term", "term");
    
        JsonPagingLoadResultReader<PagingLoadResult<ModelData>> reader = new JsonPagingLoadResultReader<PagingLoadResult<ModelData>>(type);
    
        PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy, reader);
    
        loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {
            public void handleEvent(LoadEvent be) {
            be.<ModelData> getConfig().set("start", be.<ModelData> getConfig().get("offset"));
            }
        });
    
        ListStore<ModelData> store = new ListStore<ModelData>(loader);
    I query a servlet that lives on my own server and use that as a proxy to a remote server.
    The response I get in my servlet is fine:
    Code:
    {"terms":[{"term":"content", "term2":"content2"}]}
    Am I missing something here?
    I tried adding a listener to the loader for the Loader.Load event, but that never triggers.
    Any help would be most welcome!

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,974
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default

    Your response is not fine for a ScriptTagProxy. Your server gets a callback param which you need to use. Take a look at this example and the response from the server: http://www.sencha.com/examples/explo...vancedcombobox

  3. #3
    Ext User
    Join Date
    Oct 2010
    Posts
    7
    Vote Rating
    0
    crowolf is on a distinguished road

      0  

    Default

    sven, thanks a bunch for your response!
    I went with a HttpProxy instead and that works like a charm =)

Similar Threads

  1. Problem loading Json store into a comboBox
    By marxan in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 26 Oct 2010, 1:53 AM
  2. Loading a comboBox from a JSON store
    By cwolves in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 20 Oct 2010, 10:11 AM
  3. EXTJS 3.0 Dynamically loading tree using JSON response
    By ankuravlani in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 20 Oct 2009, 10:21 AM
  4. [SOLVED] Filling up ComboBox from a JSON response
    By lobo-tuerto in forum Ext 2.x: Help & Discussion
    Replies: 20
    Last Post: 4 Feb 2008, 5:09 PM
  5. Loading json data via ajax into combobox.
    By Matthew Luke in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 14 Jun 2007, 7:18 PM

Thread Participants: 1