Thank you for your answers are really helpful.
Now, I tried to do it using data tables or using selectManyListBox and both of the cases are displaying properly in the browser. My problem is when the user submits the selected items then I cant take the user's inputs, they do not save in my arrayList.
When I tried to put id's, each iteration build a new selectManyListBox with the same id but with different values, i receive an error message that Component ID myform:myKey has already been found in the view.
I tried to solve it by putting an increment variable in id="count" and from
java e.g count++ but logically it does not work. Is this the reason that I cannot take the user's inputs ?
Another remarkable thing that I noticed is that: by using a selectManyListbox tag within a data table I can only retrieve user's input if the selected items belong to the last selectManyListbox that is created.
Do you have any suggestions?