FieldGroup, Beans inside beans and ListSelect -or Select-


I’m developing a form to edit my objects:

public class FuncionalidadVE {
	private String funcionalidad;
	private String descripcion;
public class PerfilVE {
	private int perfil;
	private String descripcion;
	private List<FuncionalidadVE> funcionalidades = new ArrayList<FuncionalidadVE>();

The complete list of FuncionalidadVE is loaded from DB, but the PerfilVE.funcionalidades only contains some of them.

I’ve managed to get working the FieldGroup, but I can´t get to work the funcionalidades.

		binder.setFieldFactory(new FieldGroupFieldFactory() {
			private DefaultFieldGroupFieldFactory defaultFactory = new DefaultFieldGroupFieldFactory();
			public <T extends Field> T createField(Class<?> dataType, Class<T> fieldType) {
				System.out.println("CREATEFIELD :: dataType : " + dataType + " :: fieldType : " + fieldType);
				if ("java.util.List".equals(dataType.getName())) {
					BeanItemContainer<FuncionalidadVE> containerFuncionalidades = new BeanItemContainer<FuncionalidadVE>(FuncionalidadVE.class);
					Field field = new ListSelect("Funcionalidades", containerFuncionalidades);
					((ListSelect) field).setItemCaptionPropertyId("descripcion");
					((ListSelect) field).setNullSelectionAllowed(true);
					((ListSelect) field).setMultiSelect(true);
					return fieldType.cast(field);
				return defaultFactory.createField(dataType, fieldType);


I’ve made a new FieldGroupFieldFactory, but when I try to use it I receive this error:

I haven’t found any example of this complex data binding, only with simple POJO.


You have to write your own Converter. See
Changing Default Converter