Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    10
    Vote Rating
    0
    agruss is on a distinguished road

      0  

    Default ListStore with List<String> ?

    ListStore with List<String> ?


    Hello,

    is it possible to fill a ListStore with a plain List<String> received via Json?

    I could not find any examples and so far I get


    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.google.gwt.core.client.JavaScriptObject
    when trying to access the list in a combo box.

    Any help would be appreciated.

    kind regards
    /anja

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    I've never used autobeans or the reader, but take a look at JsonReader. It is responsible for converting JSON in to beans which you can then load into your list store.

    Unless you want this behavior, the list store will fire an event each time an item is added so you may want to construct them all first and then add them (which will also fire an event, just one though, instead of n‚Äč.

Thread Participants: 1