itamar
20 May 2009, 8:58 AM
Hello,
I managed to show a new store for my combobox.
Follow the code below:
.....
RpcProxy proxyEstado = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
PerfilRemoteService.Util.getInstance().findAll(callback);
}
};
final BeanModelReader readerState = new BeanModelReader();
loaderState = new BaseListLoader(proxyState , readerState );
loaderState .load();
storeState = new ListStore<BeanModel>(loaderState);
comboState .setStore(storeState);
comboState .addListener(Events.Change, new Listener<DomEvent>() {
public void handleEvent(DomEvent be) {
RpcProxy proxyCity = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
stateBean = comboState .getValue().getBean();
PerfilRemoteService.Util.getInstance().findById(stateBean, callback);
}
};
final BeanModelReader readerCity = new BeanModelReader();
loaderCity = new BaseListLoader(proxyCity, readerCity);
loaderCity.load();
storeCity = new ListStore<BeanModel>(loaderCity);
comboCity.setStore(storeCity);
// After choosing the state, the combobox is not showing the cities of the state chosen ???
}
});
RpcProxy proxyCity = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
stateBean = new StateBean();
stateBean.setId(0);
PerfilRemoteService.Util.getInstance().findById(stateBean, callback); // return empty (its Ok)
}
};
final BeanModelReader readerCity = new BeanModelReader();
loaderCity = new BaseListLoader(proxyCity, readerCity);
loaderCity.load();
storeCity = new ListStore<BeanModel>(loaderCity);
comboCity.setStore(storeCity);
// initially, comboCity empty (its ok)
.....
Thanks
Itamar Nunes
I managed to show a new store for my combobox.
Follow the code below:
.....
RpcProxy proxyEstado = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
PerfilRemoteService.Util.getInstance().findAll(callback);
}
};
final BeanModelReader readerState = new BeanModelReader();
loaderState = new BaseListLoader(proxyState , readerState );
loaderState .load();
storeState = new ListStore<BeanModel>(loaderState);
comboState .setStore(storeState);
comboState .addListener(Events.Change, new Listener<DomEvent>() {
public void handleEvent(DomEvent be) {
RpcProxy proxyCity = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
stateBean = comboState .getValue().getBean();
PerfilRemoteService.Util.getInstance().findById(stateBean, callback);
}
};
final BeanModelReader readerCity = new BeanModelReader();
loaderCity = new BaseListLoader(proxyCity, readerCity);
loaderCity.load();
storeCity = new ListStore<BeanModel>(loaderCity);
comboCity.setStore(storeCity);
// After choosing the state, the combobox is not showing the cities of the state chosen ???
}
});
RpcProxy proxyCity = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
stateBean = new StateBean();
stateBean.setId(0);
PerfilRemoteService.Util.getInstance().findById(stateBean, callback); // return empty (its Ok)
}
};
final BeanModelReader readerCity = new BeanModelReader();
loaderCity = new BaseListLoader(proxyCity, readerCity);
loaderCity.load();
storeCity = new ListStore<BeanModel>(loaderCity);
comboCity.setStore(storeCity);
// initially, comboCity empty (its ok)
.....
Thanks
Itamar Nunes