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

  • Home
  • SEARCH
  • 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 7516253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:04:19+00:00 2026-05-30T01:04:19+00:00

I have a selectOneMenu that manages a relation between two Objects A and B.

  • 0

I have a selectOneMenu that manages a relation between two Objects A and B.
Where A is fixed and B is selectable via the menu.
On form submit B is send to the bean for further processing (creating and saving relationship object AToB).

Not working case!

<h:selectOneMenu value=#{b}>
    <!-- b items from bean -->
</h:selectOneMenu>
<h:commandButton action="#{bean.addBToSelA(b)}"/>

<managed-bean>
    <description>B Entity Request Bean</description>
    <managed-bean-name>b</managed-bean-name>
    <managed-bean-class>B</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

Working case!

But if the selectOneMenu value is a nested property of a different managed bean it works. (as example AToB)

<h:selectOneMenu value=#{aToB.b}>
    <!-- b items from bean -->
</h:selectOneMenu>
<h:commandButton action="#{bean.addBToSelA(aToB.b)}"/>

<managed-bean>
    <description>AToB Entity Request Bean</description>
    <managed-bean-name>aToB</managed-bean-name>
    <managed-bean-class>AToB</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

Note: It is enough if my “b” is just a property of a different request managed bean.

Can someone be so kind and explain why?

  • 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-30T01:04:21+00:00Added an answer on May 30, 2026 at 1:04 am

    Because JSF has already created the bean instance beforehand. It won’t be overridden with the model value if the instance already exist in the scope. Remove the <managed-bean> from faces-config.xml and it’ll work just fine.


    Unrelated to the concrete problem, you seem to be already using JSF 2.x. Why sticking to the old JSF 1.x style faces-config.xml configuration? Just use @ManagedBean annotation (on real backing bean classes only, of course).

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

Sidebar

Related Questions

I have a <h:selectOneMenu> that has <f:selectItems> with CategoryHistory objects loaded in it. I
I have two JSF <h:selectOneMenu> components. One called category another is subcategory . If
I have two datatables. One is to display names. Another contains three <h:selectOneMenu> .
At my view I have two menus that I want to make dependent, namely,
I want to have multiple <h:selectOneMenu> that are displayed by selection of main <h:selectOneMenu>
I have the following peace of code: <h:selectOneMenu id=countrycode styleClass=Width300 value=#{customer.countrycode} valueChangeListener=#{customer.countrycodechange} onchange=submit() immediate=true
I have a situation where there is a selectOneMenu that has a value bound
I have table with two SelectOneMenu in row. I need populate data in second
I have a selectOneMenu that displays some different stuff categories: <h:selectOneMenu value=#{searchController.selectedCategory}> <f:selectItems value=#{searchController.formatedCategories()}
I have a table with 2 selectOneMenu components. I would like that once a

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.