GWT-Ext ComboBox loading from XML

09Jun09

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

Advertisements


No Responses Yet to “GWT-Ext ComboBox loading from XML”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: