I have a list of Strings in a java bean. In the GUI everytime after clicking a button a new p:SelectOneMenu should be created and the content of Sting list should be populated to it.
By clicking again on the button a second SelectOneMenu should be rendereded. This should be x times possible and x is the size of my String list. It means at the end we will have x SelectOneMenus. In every SelectOneMenu the last selected items should be excluded from the list. So the last one would contain only one item.
Example:
List stringList={foo,bar,baz}
By clicking on the button, the first SelectOneMenu will be rendered which contains foo,bar,baz. the first item "bar" is selected.
The button will be clicked again and a second SelectOneMenu will be rendered which should conrain only foo & baz and so on.
What would be the best and the most elegant way to implement this requirement?