I'm currently trying to get the TriStateSelectManyCheckbox to work and I used the converter example as an information source.
So instead the State object within the Map I have my own TestObject in the Map as value. It implements Serializable and has a toString() method and it is a POJO.
I also implemented a converter for the TestObject class.
The big difference to the example is, that I do not put provide String values as f:selectItems but a List of TestObjects:
Code: Select all
<f:selectItems value="#{facetController.availableEntries}" var="entry" itemDescription="#{entry.description}" itemLabel="#{entry.label}" itemValue="#{entry}" />
Code: Select all
java.lang.ClassCastException: de.l3s.dlg.bi2son.view.controller.TestObject cannot be cast to java.lang.String
at org.primefaces.extensions.component.tristatemanycheckbox.TriStateManyCheckboxRenderer.encodeOption(TriStateManyCheckboxRenderer.java:169)
Code: Select all
String itemValue = (String) option.getValue();
So am I right, that this is my problem? And is there any possibility not having simple String values as f:selectItems?
Bests,
Beer