invalid value in selectitems when we refresh the selectitems
June 28, 2011
Posted by on
here’s the scenario: there’s a selectonemenu on the page, which dynamically load items based on the customer’s selection on another drop down list on the same page. problem is that after we loading new items for this selectonemenu, we can see them but trying to save will give error “invalid value”.
The new selected item can’t be found in the latest selected items. This is classic hashCode(), equals() issue, we just need to overwrite the equals method, and let two entity with the same value equal to each other.
e.g: LeadJobDetails.xhtml vet setting