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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:50:06+00:00 2026-05-27T00:50:06+00:00

I have the following peace of code: <h:selectOneMenu id=countrycode styleClass=Width300 value=#{customer.countrycode} valueChangeListener=#{customer.countrycodechange} onchange=submit() immediate=true

  • 0

I have the following peace of code:

        <h:selectOneMenu id="countrycode"
                styleClass="Width300"
                value="#{customer.countrycode}"
                valueChangeListener="#{customer.countrycodechange}"
                onchange="submit()"
                immediate="true"
                rendered="#{customer.validcountry}">
                <f:selectItem itemValue="None"
                    itemLabel="-------Select a Country------" />
                <f:selectItem itemValue="AU" itemLabel="Australia" />
                <f:selectItem itemValue="NZ" itemLabel="New Zealand" />
        </h:selectOneMenu>

The ValueChangeListener works only if i leave out the rendered attribute, with rendered attribute the countrycodechange never gets fired! Is there a way around this?

Same is true for adding disabled attribute , which stops valueChangeListener from firing. My valueChangeListener backbean has:

    public void countrycodechange (ValueChangeEvent vce) {

        PhaseId phaseId = vce.getPhaseId();
        if (phaseId.equals(PhaseId.ANY_PHASE))
        {
            vce.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
            vce.queue();
        }
        else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES))
        {
            ...

any help would be appreciated.

  • 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-27T00:50:07+00:00Added an answer on May 27, 2026 at 12:50 am

    Input components will only be processed when their rendered and disabled attributes evaluate respectively to true and false during the form submit. So, you need to make sure that #{customer.validcountry} evaluates the same during the form submit as it did during displaying the form. Apparently in your case the bean is request scoped or the isValidcountry() depends on a request scoped parameter which isn’t properly preserved during the form submit. You need to make sure that you preserve the same condition during the form submit.

    In JSF 2.0 that would be a matter of putting the bean in the view scope instead of the request scope. However, seeing your valueChangeListener hack, I think that you’re still using JSF 1.x which does not have the view scope yet. The right solution is hard to propose without seeing the rest of the code. It does at least not make sense to me to have a rendered attribute on “is a valid country?” while the input component itself should select a valid country.

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

Sidebar

Related Questions

I have the following code which basically is a checkbox that causes a submit
I have follwowing peace of code in which I have specified the leaky line
So, I'm finishing up an iPhone App. I have the following code in place
I am new to Java and junit. I have the following peice of code
I'm trying to select data from the database and I have the following code
I have the following code in place, and it works: private void OnEvent(object sender,
I have the following code in place: NSString *mapIDx = @98; NSLog(@map id: %@,
I have the following code in place: - (void)viewDidLoad { NSString *homeDirectoryPath = NSHomeDirectory();
I have the following code with private static members. All of these classes say
I have following JS code (stripped to minimal size where problem still exists) <html>

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.