Is there any reason why SelectOneChoice (or any other selection component for
that matter) can't check to see if that submitted value is one of the
SelectItems values?
Something like:
List<SelectItem> items = SelectItemSupport.getSelectItems(component,
SelectItemSupport.getConverter(component));
for (SelectItem item : items) {
if (item.getValue() != null && item.getValue().equals(value)) {
return true;
}
}
The reason is that I have a scenario where the value gets lost due to a
UINamingContainer row index insertion in child components id. This causes the
value to be set to an empty String. Which, in this case, is not a valid
SelectOneChoice > SelectItem value.
It just seems logical that the SelectOneChoiceRenderer is already cycling
through the List<SelectItem> that it could also check to see if the submitted
value is a valid SelectItem value?