webtier@glassfish.java.net

getting object in h:selectOneMenu and f:selectItems

From: <webtier_at_javadesktop.org>
Date: Wed, 14 Jul 2010 02:27:25 PDT

Hi,

I've got a vector, which contains objects of type MyClass with an attribute name. I put this vector (testVector) in a selectetItems-Tag and configure this Tag to show the attribute name of each object in the selectOneMenu. Now I would like to get an object and no String, when the user select an item in a selectOneMenu. But I get a String like [de.test.beans.MyClass_at_629814, de.test.beans.MyClass_at_ee58a1, de.test.beans.MyClass_at_1fce0aa, ...]!?
My code is the following:
<h:selectOneMenu id="selectDepartment" value="#{flowScope.selectetObject}">
    <f:selectItems value="#{testVector}" var="vectorEntry" itemValue="#{vectorEntry}" itemLabel="#{vectorEntry.name}" />
  </h:selectOneMenu>

Is it a bug of JSF or could you get only Strings on a selectOneMenu?
For your information: I use Mojarra 2.0.2, RichFaces 3.3.3 and Spring Web Flow 2.1.
[Message sent by forum member 'andy85']

http://forums.java.net/jive/thread.jspa?messageID=477601