Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3676040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:03:06+00:00 2026-05-19T03:03:06+00:00

Hi: I am developing a jsf project, I am having touble with getting selectOneMenu

  • 0

Hi:
I am developing a jsf project, I am having touble with getting selectOneMenu to work.

<h:selectOneMenu value="#{employeeEditBean.employeeBean}">
      <f:selectItems value="#{employeeEditBean.branchList}" />
     </h:selectOneMenu>
public class EmployeeEditHandler
{
 private String paramEmPK;
 private Employee employeeBean;
 private List<Branch> branchList;

 private int branchFK;


 public EmployeeEditHandler()
 {
  paramEmPK = FacesContext.getCurrentInstance().getExternalContext()
    .getRequestParameterMap().get("emPK");
  int emPK = Integer.parseInt(paramEmPK);
  branchList = new ArrayList<Branch>();
  employeeBean = new Employee();
  FacesContext context = FacesContext.getCurrentInstance();
  try 
  {
   employeeBean = DaoFactory.getEmployeeDao().lookupEmployeeByPK(emPK);
   branchFK = employeeBean.getBranchFK();
   branchList = DaoFactory.getBranchDao().findAllBranch();

  } 
  catch (Exception e) {
   FacesMessage msg = new FacesMessage(e.getMessage());
   msg.setSeverity(FacesMessage.SEVERITY_ERROR);
   context.addMessage("employeeEditForm", msg);
  }
 }

The error is:javax.servlet.ServletException: Argument Error: An option for component j_id8 was not an instance of javax.faces.model.SelectItem. Type found: java.util.ArrayList.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:03:06+00:00Added an answer on May 19, 2026 at 3:03 am

    You need your employeeEditBean.branchList to be of type List<SelectItem>, where each SelectItem has a value (the string that will be transferred as a post parameter) and a label.

    So you’d need to create that list based on your original branch list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Java EE project (used EJB3, JSF and maven) running on
Using Eclipse Helios, I tried to start a JSF based project. After having created
I`m developing an application using Spring WebFlow 2, Facelets and JSF. One of my
I am developing a JSF web application on a Windows box using Emacs as
i am developing in JSF a Spring Security application. the login form is fine.
I'm developing a JSF 2.0 application on Glassfish v3 and i'm trying to handle
I've been developing a few JSF applications lately and am disturbed with the inconsistency
I'm using IBM RAD with a WAS 7.0 application server. I'm developing a JSF
I'm developing a java EE web app using JSF with a shopping cart style
Im developing a game engine for iphone in C++ but im getting a crash

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.