Problème d'affichage combobox
Bonjour,
Je suis en train de développer une petite application en GWT 2.2.0 (+GXT 2.2.4).
J'ai besoin d'afficher une ComboBox dans un DialogBox mais impossible :
- seul l'invite de la Combo s'affiche,
- l'icone de déroulement ne s'affiche pas,
- quoi que je tapes, elle me renvoie "null".
ci-dessous le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
public class FichierAjoutBox extends DialogBox {
static ComboBox<TypeMorceau> typeComboBox;
static {
ListStore<TypeMorceau> typeStore = new ListStore<TypeMorceau>();
typeStore.add(getTypesMorceau());
typeComboBox = new ComboBox<TypeMorceau>();
typeComboBox.setStore(typeStore);
typeComboBox.setForceSelection(true);
typeComboBox.setMinChars(1);
typeComboBox.setFieldLabel("Type");
typeComboBox.setDisplayField("libelle");
typeComboBox.setEmptyText("Choisir le type");
typeComboBox.setTypeAhead(true);
typeComboBox.setSelectOnFocus(true);
typeComboBox.setTriggerAction(TriggerAction.ALL);
typeComboBox.setWidth(200);
typeComboBox.setHideTrigger(false);
}
public FichierAjoutBox() {
setTitle("Nouveau fichier");
center();
setWidget(typeComboBox);
this.show();
}
private static List<TypeMorceau> getTypesMorceau() {
List<TypeMorceau> types = new ArrayList<TypeMorceau>();
types.add(new TypeMorceau("A", "Accords"));
types.add(new TypeMorceau("G", "Guitar Pro"));
types.add(new TypeMorceau("K", "Karaoké"));
types.add(new TypeMorceau("M", "Midi"));
types.add(new TypeMorceau("P", "Partitions"));
types.add(new TypeMorceau("T", "Tablatures"));
return types;
}
}
public class TypeMorceau extends BaseModelData {
private static final long serialVersionUID = 1L;
private String code;
private String libelle;
public TypeMorceau() {
super();
}
public TypeMorceau(String code, String libelle) {
super();
this.code = code;
this.libelle = libelle;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getLibelle() {
return libelle;
}
public void setLibelle(String libelle) {
this.libelle = libelle;
}
} |
Si quelqu'un a une idée, merci de m'en faire part.
Cordialement.