Customized Converter for String to Enum

I wrote the Customized converter for String to Enum (for OptionalGroup field), when ever i tried to bind the values, convertToModel() and convertToPresentation() methods are getting called trice with values of null, which results in invalid data binding .

Converter should handle null values. convertToModel and convertToPresentation may receive null values.

Hi Johannes,

Thanks for the Comment, and in the above case
how to clear the OptionalGroup,
the statements setValue(null) and selected(null) are not working as i have already dealt the null condition in Converter methods- convertToModel(), convertToPresentation(). Please guide me here.

Well null should be the value of cleared OptionGroup. How are you handling the null in Converter?