In my application I have two list boxes (selectOneListBox) one representing available values (pre populated) and one representing selected values (empty). Both list boxes are have the f:selectItems tag which is bound to a variable in the backing bean. When I choose a value from the Available list and click on the "add" button, I use JQuery to transfer the selected item from the Available list to the Selected List. All this works fine.
However when I click on the save button (h:commandButton) my application goes through the various life cycle phases and when it reaches the process validation phase, it performs a SelectItemsIterator on both Lists but fails on the Selected List with the error "NoSuchElementException()" since it was initially empty. I initialized the List Boxes as follows.
I have tried initializing the Map to have an empty key and value pair, but when I run the application,
the list item contains an empty entry, and that is also allowed to be moved between lists when I add to or remove from the Selected List.
I would like to know if there is a way to bypass the list validation.
All I require is that After I transfer the Items from Available List to Selected List and hit submit, I need to be able to access the List items in the backing bean. If you have a work around to my problem stated above or if you have a completely different approach in handling this problem I would be really happy to hear from you. thanks for your replies in advance.