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 7167079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:31:08+00:00 2026-05-28T14:31:08+00:00

I got a problem described in the title. My selectOneMenu doesn’t change my Value

  • 0

I got a problem described in the title. My selectOneMenu doesn’t change my Value :/

<h:column>
                        <f:facet name="header">
                            <h:outputText value="Vorgesetzter" />
                        </f:facet>
                        <h:outputText
                            value="#{s.manager.surename}, #{s.manager.forename}"
                            rendered="#{not s.editable}" />
                        <h:selectOneMenu value="#{s.manager.userID}"
                            styleClass="inputlabel" id="Vorgesetzter"
                            rendered="#{s.editable}">
                            <f:selectItem
                            itemValue="${null}" itemLabel="-"/>
                            <f:selectItems value="#{userBean.userList}" var="us"
                                itemLabel="#{us.surename}, #{us.forename}"
                                itemValue="#{us.userID}" />
                        </h:selectOneMenu>
                    </h:column>
                    <h:column>
                        <h:commandButton value="bearbeiten"
                            action="#{sectionBean.switchEdit(s)}" 
                            rendered="#{not s.editable}" />
                        <h:commandButton value="speichern"
                            action="#{sectionBean.updateSection(s)}"
                            rendered="#{s.editable}" />
                        <h:commandButton value="abbrechen"
                            action="#{sectionBean.switchEdit(s)}"
                            rendered="#{s.editable}" />
                    </h:column>

this is a piece of the sections.xhtml. It’s sourrounded by a form tag.

This is my bean:

package at.ac.htlperg.beans;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import at.ac.htlperg.dao.SectionDAO;
import at.ac.htlperg.model.Section;
@ManagedBean
@SessionScoped
public class SectionBean {
    SectionDAO sectionDAO;

public SectionBean() {
    sectionDAO = new SectionDAO();
}

public SectionDAO getSectionDAO() {
    return sectionDAO;
}

public void setSectionDAO(SectionDAO sectionDAO) {
    this.sectionDAO = sectionDAO;
}

public List<Section> getSectionList() {
    return sectionDAO.getSectionList();
}

public String deleteSection(Section s) {
    sectionDAO.deleteSection(s);
    return null;
}

public String switchEdit(Section s) {
    sectionDAO.switchEdit(s);
    return null;
}

public String saveSection() {
    sectionDAO.saveSection(sectionDAO.getSection());
    return "/secured/sealed/sections.xhtml";
}

public String updateSection(Section s) {
    sectionDAO.updateSection(s);
    this.switchEdit(s);
    return null;
}

}

the method updateSection should access the Database and does an session.update(s).
But it doesn’t save the new values, neither in the selectOneMenu, nor in the usual textbox above (not in the shown code).

Anyone knows what’s wrong?

  • 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-28T14:31:10+00:00Added an answer on May 28, 2026 at 2:31 pm

    Don’t know if it helps, but in JSF 1.2 I had similar issues. The Problem was that h:selectOneMenu returned String values instead of Objects I suspected.

    Maybe this “bug” wasn’t solved for JSF2.0.

    try something like:

    // ManagedBean
    String userId;
    
    String getUserId(){return this.userId;}
    void setUserId(String userId){this.userId = userId;}
    
    // JSF
    <h:selectOneMenu value="#{managedBean.userId}"
                            styleClass="inputlabel" id="Vorgesetzter"
                            rendered="#{s.editable}">                            
        <f:selectItems value="#{userBean.userList}" var="us"
                       itemLabel="#{us.surename}, #{us.forename}"
                       itemValue="#{us.userID}" />
    </h:selectOneMenu>
    

    and before working with userId convert it into the Object you want, or just try to use a converter.

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

Sidebar

Related Questions

I have a problem as i've described in title. I've got menu and I
I've got a problem similar to,but subtly different from, that described here (Loading assemblies
Problem is easier to be seen in code then described I got following regex
I've got a problem concerning combinatorics. Unfortunately, I can't describe it abstractly so I
I've got a strange problem. Let me first describe my situation: Webserver01 (Webapplication, SQL,
i got problem with my code and hopefully someone able to figure it out.
I've got problem with connecting to MySQL database on my freshly installed Windows 7
Got a problem with ADOMD.NET 8.0, SQL2008 and our app. It isn't giving us
Got a problem with a query I'm trying to write. I have a table
Got a problem with ComponentListener. I'm using it to check if a certain component

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.