You forgot to set the itemLabel
attribute.
<f:selectItems ... itemLabel="#{transportadora.nome}" />
The itemValue
only sets the actual item value, not the item label. The item value is what's been submitted from client to server. The item label is what's been shown to the world. If the item label is absent, then by default the item value is shown. But as it's a complex entity and you didn't specify any converter, then it defaults to toString()
result of Transportadora
class.
See also:
Unrelated to the concrete problem, you perhaps also want to set itemValue
to the same as in
<f:selectItems ... itemValue="#{transportadora.nome}" />
because your property is a String
, not a Transportdora
. You (read: JSF) can't set a Transportdora
object in a String
property. Otherwise, you need to change it to #{onibusMB.transportadora}
and provide a converter.