Reputation: 69
I am getting an error message in my JSF pages... Conversion error setting value 'delovenier' for 'null converter'
, where delovenier is the name of the chosen project.
I'm not sure why this is happening. Could someone please assist me.
This is my JSF code...
<h:selectOneListbox id="proj" value ="#{studentEController.gekozenProject}">
<f:selectItems value="#{studentEController.projecten}"></f:selectItems>
</h:selectOneListbox>
And this is my code in the managedBean StudentEController
.
private List<ProjectE> projecten;
private ProjectE gekozenProject;
As you can see, they have the same type of ProjectE
.
Upvotes: 1
Views: 881
Reputation: 108949
Data transferred between the server and the client will be in string form.
The Expression Language can coerce a set of standard types (ints, etc.), but for complex types you are going to have to add a Converter to your component. Your converter will serialize ProjectE
types to strings at render time and deserialize them to new ProjectE
instances when forms are submitted.
You can create converters for specific types or add them explicitly to components.
See Creating a Custom Converter in the Java EE 6 tutorial and the <f:converter>
tag.
Upvotes: 3