1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    2
    Vote Rating
    0
    gxtdev is on a distinguished road

      0  

    Default ComboBox render(..) method issue

    ComboBox render(..) method issue


    The following code is working

    public void onModuleLoad()
    {
    ComboBox<State> box = new ComboBox<State>();
    State state = new State()
    state.setName("California");
    state.setCode("CA");
    ListStore<State> store = new ListStore<State>();
    store.add(state);
    box.setStore(store);
    box.setDisplayField("name");
    RootPanel.get().add(box);
    }


    The following code display's the combobox but it will not display any data. I think it is in disable mode. Don't know why?

    public void onModuleLoad()
    {
    ComboBox<State> box = new ComboBox<State>();
    State state = new State()
    state.setName("California");
    state.setCode("CA");
    ListStore<State> store = new ListStore<State>();
    store.add(state);
    box.setStore(store);
    box.setDisplayField("name");
    box.render(RootPanel.getBodyElement());
    }


    Any idea why it is failing? Other than combobox rest of the GXT fields it is working.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,717
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    It is not attached if you only render it.

  3. #3
    Ext User
    Join Date
    Jun 2009
    Posts
    2
    Vote Rating
    0
    gxtdev is on a distinguished road

      0  

    Default


    You mean attaching to the dom? or attaching the store to the combox box?

    If it is not attached to the DOM I can not see a combobox. But I can see a combobox without store data