PDA

View Full Version : ComboBox render(..) method issue



gxtdev
18 Jun 2009, 2:56 PM
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.

sven
18 Jun 2009, 3:01 PM
It is not attached if you only render it.

gxtdev
18 Jun 2009, 3:24 PM
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