Hello,
My problem is very simple. I have a list of objects in my bean (ex: List<Apple> applies = new ArrayList<Apple>() ).
The object has several fields (ex: supplier, color, width, height, breadth, etc.)
I want to show this list on the front end. However I also want to allow the user to edit the attributes of the apples.
So from the front end I will have like a list of fields where a set of fields is related to a single object in the list.
I would also like to add/delete apples.
What first came to my mind is to map every field in the object Apple to a List. For example if Apple has field suppliers and field color then in the bean I would create two Lists, List<
String> supplier, and List<String> color.
From the front end I would display the contents of these Lists rather then the List<Apple> apples.
The name of the field would be the same for each set of attributes.
On save (form submit) the Lists would be re-populated with the field values (changed or not) and then I would be my Apple objects from the bean before saving in database.
However I am not sure if there is something in
JSF that can help me achieve this in a simple way, working only with List<Apple> rather than adding additional Lists.