In JSF, it is required that the submitted values for select boxes are a subset of the original SelectItems. In other words, if you have values 1,2,3,4,5 displayed in a select box, the submitted values need to be some subset of 1,2,3,4,5, and any value other than these is invalid. You have a few options:
1. In the value change listener, try to modify the list the receiving selectbox uses and use immediate=true on it. I haven't gotten this to work. JSF doesn't update the values in the component tree for some reason.
2. Write your own JSF component which consists of two select boxes and two buttons (Add/Remove), something like the Tomahawk component.
thank you dear for your help,
I have 2 drop down lists:
untill here all of the values populate in the list successfully.
but when i submit the values, the state component give me error message "value is not valid".
I dont know why it is telling that the value is invalid when the process that i did was working fine, accept the error message.