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

The Archive Base Latest Questions

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

I have a situation where there is a selectOneMenu that has a value bound

  • 0

I have a situation where there is a selectOneMenu that has a value bound to a backing bean.

I need to have a button that doesn’t update model values (that is why it has immediate=’true’ property).

That button’s action method changes the value the selectOneMenu is bound to, but when the page is redisplayed the original value is displayed (the one that was submitted) and not the one set in the action method.

Any ideas why that is happening?

If I didn’t explain the problem good enough please let me know.


EDIT: As requested here is the source code in question:

page code:

<h:selectOneMenu id='selectedPerson'                   binding='#{bindings.selectPersonComponent}'                   value='#{bean.selectedPerson}'>    <s:selectItems var='op' value='#{bean.allPersons}'                    label='#{op.osoba.ime} #{op.osoba.prezime}'                    noSelectionLabel='#{messages.selectAPerson}'>    </s:selectItems>    <f:converter converterId='unmanagedEntityConverter' /> </h:selectOneMenu> ... <a4j:commandButton action='#{bean.createNew}' value='#{messages.createNew}'      immediate='true' reRender='panelImovine'> </a4j:commandButton> 

java code:

private Person selectedPerson;  public String createNew() {     log.debug('New created...');     selectedPerson = null;     bindings.getSelectPersonComponent().setSubmittedValue(null); //SOLUTION     return ''; } 

The solution is in the lined marked SOLUTION 🙂

  • 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. 2026-05-11T14:58:32+00:00Added an answer on May 11, 2026 at 2:58 pm

    As it frequently happens a few moments after posting this question I have found an answer:

    The cause of the problem is in detail explained here: ClearInputComponents

    The problem is (as explained) that model values haven’t been updated so the submitted inputs are still in component.submittedValue field and that field is displayed if not empty. It is emptied normally after model has been updated.

    The first solution didn’t work in my case because there is other important state in the view that mustn’t get lost. But the second solution worked great:

    component.setSubmittedValue(null); 

    And that was all that was needed: it is a little extra work because components must be bound to some bean, but not that bad.

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

Sidebar

Related Questions

I have the following situation: There is a windows folder that has been mounted
I have the following situation: There is a tool that gets an XSLT from
I have a situation where there is a small piece of Java code that
I have a situation where there is a rule with a shift/reduce conflict that
I have the following situation: there is a table in the DB that is
I have this situation: There are a login page with a login form (form
I have the following situation: There is one custom view inside of the first
Let's say I have a situation in Silverlight where there is a background thread
I have situation, where running a query that filters by an indexed column in
I have such situation: There is 8 div-blocks with ids like 'rateN_wrapper' where is

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.