home about Conferences rss feed  rss

GWT-Ext ComboBox loading from XML

09 Jun 2009

This is a simple example on how to make a ComboBox in Gwt-Ext to populate with XML.

HttpProxy proxy = new HttpProxy("xml/combo_data.xml", Connection.GET);

final RecordDef recordDef = new RecordDef(new FieldDef[] { new StringFieldDef("id"), new StringFieldDef("value") });

XmlReader reader = new XmlReader("comboitem", recordDef);

`final Store store = new Store(proxy, reader);

ComboBox combo = new ComboBox(); combo.setLabel(“Combo Label”); combo.setStore(store); combo.setDisplayField(“value”); combo.setMode(ComboBox.REMOTE); combo.setTypeAhead(true); this.rootPanel.add(combo);


store.load(); And the xml can be seen here

Hope it helps

If you want to discuss this post, the best place right now for me is twiter, please @silverspoon with your comment/question.