You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by William Hoover <wh...@nemours.org> on 2007/03/29 16:27:49 UTC

SelectOneChoice and lost values...

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?