This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Converter can only return null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Converter can only return null" Watch "Converter can only return null" New topic

Converter can only return null

Matthias Baumann

Joined: Oct 11, 2011
Posts: 1
Hi everybody!

I have a really strange problem and I need some help from the experts=)

I have an SelectOneListBox with values which come from a bean. This works pretty good. Now I wanted to get the selected value as property of my bean. Because it is a complex type I added a converter to the project. This also worked pretty well. Because of a change in the business logic I had to change the the object which gets passed to the listbox and to the converter. I there the problems started.
At first I had the behavior that non of the frontend values was set in my bean but I got no error message at all. I discovered that I can make all properties except the for the selecteditem work if my converter returns only null. As soon as I return the correct type (the object has the correct type, I checked this) nothing works but I get no error. I expect that the converter is the cause of my problem. But I have no approach what I can do to make it work. That is the main reason I am posting here.
Are there any restrictions for the objects returned by a converter that I am not aware of (e.g. is a getter and setter for every field mandatory)? Or has anybody an idea what the cause of this behavior might be?

Thank you for your help!
It is sorta covered in the JavaRanch Style Guide.
subject: Converter can only return null
Similar Threads
date conversion problem
long post IBM.158
Polymorphism OO Design Question
JSF2 Populate SelectOneRadio with Enum values