Hi, I found another issue, I have seen some examples of. how to do it on the forum and the documentation but I having problems, I have the next bean:
Questionary{
String id;
Timestamp questionDateTime,
Set<Question> questions = new Hashset<>()
..
..
}
and on my previous version of this app I had a Form with a CustomField
that reads the Set (on my original version was an Question) and fill a Grid to edit some data of this Set. I added the FieldType, and tryed with FieldProvider but I can retrieve the Set from my custom component, the methods ‘generateModelValue’ or ‘setPresentationValue’ are never called
public class QuestionFields extends CustomField<Set<Question>> {
@Override
protected Set<Question> generateModelValue() {
HashSet<Question> set = new HashSet<>();
set.addAll(questionList);
return set ;
}
@Override
protected void setPresentationValue(Set<Question> questions) {
questionList.clear();
questionList.addAll( questions );
}
}
and on my CRUD component:
crud.getCrudFormFactory().setFieldType("questions", QuestionFields.class);
crud.getCrudFormFactory().setFieldCreationListener("questions", (field) -> {
((QuestionFields) field).setSystemDao(this.gameDao); //
});
/* crud.getCrudFormFactory().setFieldProvider("questions", ()-> {
QuestionFields questionField = new QuestionFields();
questionField.setSystemDao(this.gameDao);
return questionField;
}
); */
What Im doing wrong?