1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
List<Entreprise> entreprises = this.getEntreprise();
Collections.sort(entreprises, new Comparator<Entreprise>() {
@Override
public int compare(Entreprise o1, Entreprise o2) {
return o1.getCompanyName().compareTo(o2.getCompanyName());
}
});
ListStore<Entreprise> store = new ListStore<Entreprise>();
store.add(entreprises);
ComboBox<Entreprise> combo = new ComboBox<Entreprise>();
combo.setFieldLabel("Entreprise");
combo.setDisplayField("companyName");
combo.setEnabled(true);
combo.setTriggerAction(TriggerAction.ALL);
combo.setStore(store); |