It has evolved into an Integer.
My original code was :

<h:selectOneMenu id="projMgr" value="#{ProjectBean.project.organizationPeople.peopleId}" >

which eventually maps back to my HIbernate stuff.
I thought I'd simplify it and just see if I could get the integer value back into the Bean, so I added the projectManager to the ProjectBean as an Integer to reduce the layers for errors.


Thanks,

Steve


On Mon, 2006-07-03 at 15:06 -0400, Neuman, Ben J., A&M IRM wrote:
Steven,
is ProjectBean.projectManager an instance of OrganizationPeople or Integer?

[Neuman, Ben J., A&M IRM] 
 
 -----Original Message-----
From: Steven Peacock [mailto:[EMAIL PROTECTED]
Sent: Monday, July 03, 2006 2:22 PM
To: MyFaces Discussion
Subject: Value is not a valid option on a selectOneMenu


I am having a problem that is vexing me, and I can't seem to find a reference to exactly what I am experiencing.

I have a jsp with the following code:

<h:outputLabel for="" styleClass="label" >
   <h:outputText value="#{bundle.projManagerLabel}" />
</h:outputLabel>
<h:selectOneListbox id="projMgr" value="#{ProjectBean.projectManager}" >
   <f:convertNumber integerOnly="true" />
      <f:selectItems value ="#{ProjectBean.projectManagerSelectList}"/>
</h:selectOneListbox>
<h:message for="" />

The code for the select item method is:

public List getProjectManagerSelectList () {
   List potentialManagers = projectControl.getProjectManagerList();
   Iterator managerList = potentialManagers.iterator();
   List selectItemTypes = new ArrayList();
   while (managerList.hasNext()) {
      OrganizationPeople managerType = (OrganizationPeople) managerList.next();
      selectItemTypes.add(new SelectItem(managerType.getPeopleId(),managerType.getPersonFirstName() + " " + managerType.getPersonLastName()));
   }
   return(selectItemTypes);
}
The managerType.getPeopleId() returns an Integer.

The html page displays properly, and I get a nice drop down to select the project manager. If I look at the source code, I see what looks like a good select list. A sample of one of the lines is here:
<option value="22" selected="selected">John Doe</option>

But when I submit my form, I get:

"projMgr": Value is not a valid option.


I am using myfaces-all.jar that indicates it is a 1.1.1 and deployed on Tomcat via MyEclipse.



Thanks,

Steven Peacock






Reply via email to