The error message 'value is not valid' is because of list box item sent to server does not exist or match in the items list box. Please see below example:
<!-- the jsf page -->
<h: outputText value="Select one of item only: "/>
<h:selectOneMenu value="#{testPageBean.yourdefaultNewValue}" id="test" required="true" onchange="submit()"
valueChangeListener="#{testPageBean.listListner}">
<f:selectItems value="#{testPageBean.allOfYourListItems}" />
</h:selectOneMenu>
/* the bean values and methods */
public void listListner(ValueChangeEvent event)
{
System.out.println("listListner");
/*make sure you use
string for your list and the keys in your list box
if the new value that is selected does not have the same type or if the value does not exist in
your allOfYourListItems then you will get the "Validation Error: Value is not valid" error on your page
*/
yourdefaultNewValue = event.getNewValue().toString();
}
// * I'm assuming you have created your getter and setter properly too.
Good luck ,
Alireza Aghamohammadi