PDA

View Full Version : Async ComboBox doesn't show any values



dangeruss
29 Apr 2008, 8:34 AM
Trying to implement a combobox that populates itself from my database service. I finally got it to render with no errors, but it does not show any items. I've tried various things like commitChanges() on the store, store.load(), combobox.render(), but to no avail. Any insight?



public abstract class EYEComboBox extends ComboBox {
public String tableName;
public DBServiceAsync db;
public List<Record> records;
public RpcMap criteria;
public Store store;
public EYEComboBox thisComboBox;

public EYEComboBox(RpcMap searchCriteria){
thisComboBox = this;
criteria = searchCriteria;
store = new Store();
setStore(store);
tableName = defineTableName();
fieldLabel = defineFieldLabel();
displayField = defineDisplayField();
setWidth(defineWidth());
db = DBService.Util.getInstance();
getMatchingRows();
}

public abstract String defineFieldLabel();
public abstract String defineDisplayField();
public abstract int defineWidth();
public abstract String defineTableName();
public abstract String definePrimaryKey();

private void getMatchingRows(){
db.getMatchingRecords(tableName, criteria, new AsyncCallback(){
public void onSuccess(Object result){
records = (List<Record>)result;
store.add(records);
store.commitChanges();
}
public void onFailure(Throwable caught){
MessageBox.alert("Failure", caught.getMessage(), null);
}
});
}
}

dangeruss
30 Apr 2008, 6:15 PM
This was fixed with Beta2.