"selectonemenu with complex objects, is a converter necessary? " Code Answer


you need a converter here, as jsf will assume strings by default, that is the way you coded it. jsf has no idea how to convert your pseudo entities to strings and vice versa.

some notes:

1 . your getasstring method defines your identifier for your entities/pojos, not what the jsf (or whatever) select gets as itemlabel.

2 . your converter can dig into the db for real entities using this infamous article:


you can also use cdi annotations with that "pattern".

3 . your value = "bean"is redundant and the cdi scope of choice is usually @viewscoped. however, you have to keep in mind that cdi @named + jsf @viewscoped isn't working together without using seam 3 or apache myfaces codi.

By ephemeron on October 14 2022

Answers related to “selectonemenu with complex objects, is a converter necessary? ”

Only authorized users can answer the Search term. Please sign in first, or register a free account.