I have a bean
class MyBean {
Integer code;
String name
Integer typeCode;
}
MyBean myBean ;
and a list with types descriptions
[color=#0000FF]
class TypeDescription {
Integer typeCode;
String typeDescription;
}
List listrOfTypesDescriptions
[/color]
- in the form, the comboBox must show list of types (listrOfTypesDescriptions)
- and the type selected must be stored in the field typeCode of my object (Integer myBean.typeCode )
I defines ComboBox Type : TypeDescription
protected ComboBox cbxType;
and assign to ComboBox a list of TypeDescription
cbxType.setItems(listrOfTypesDescriptions)
how I bind ComboBox to bean attribute typeCode?
- ComboBox Type is TypeDescription
- typeCode type is Integer
binding generate error
[color=#0000FF]
Binder binder = new Binder<>(MyBean .class);
binder.forField(“type”)
.bind( MyBean ::getType, MyBean ::setType));
[/color]
becouse ComboBox Type is TypeDescription
thanks for any help