PDA

View Full Version : Help with storeDataChanged



Francesco1006
1 Feb 2012, 8:51 AM
Hello, I am new to ext-gwt. I have a combobox (mycombo), I want to set my combobox with the value of the first BeanModel that came into my Store when the Store is loaded. Here is my code:


mycombo.getStore().addStoreListener(new StoreListener<BeanModel>() {
@Override
public void storeDataChanged(StoreEvent<BeanModel> se) {
super.storeDataChanged(se);
mycombo.setValue(mycombo.getStore().getAt(0));
}
});

Sadly, mycombo does not has a valid value, if I execute this:


System.out.println("Size = "+mycombo.getStore().getCount());
System.out.println("Value = "+mycombo.getStore().getAt(0).get("someproperty"));

I get:


Size = 3
Value = null

That's quite true, 3 beanmodel into the store is correct, but, why do I get a null value? What am I missing? TIA

Francesco