SelectOneMenuRenderer throws "Could not match a select item for submittedOptionValue"
SelectOneMenuRenderer is not able to match the submittedOptionValue in case complex objects are used as item values.
public class AwesomePerson {
private String firstName;
private String lastName;
}
public class MyBean {
private List<AwesomePerson> selectItems;
private AwesomePerson selected;
}
<b:selectOneMenu
value="#{myBean.selected}" ajax="true">
<f:selectItems value="#{myBean.selectItems}"
var="p" itemLabel="#{p.firstName}"/>
</b:selectOneMenu>
In this scenario the item list index is used as submittedOptionValue. Handling of this usecase was removed with https://github.com/TheCoder4eu/BootsFaces-OSP/commit/57ac01d124980790741e506d8c5ce485aafccc60
I detected the same issue. The null check, because null is passed as an empty string, was lost during the converter change.
Even, if there is a fix already available, a note about it.
Another option is to use "omnifaces.selectItemsConverter" which is the option you have to use for i.E. PrimeFaces SelectOneMenu. Even if it is a comfort to have this integrated in the component. On the other hand it is now more compatible with the common.
Your bugfix has landed on Maven Central with version 2.0.0-SNAPSHOPT.
See #369 to get instructions on how to get the snapshot.