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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:47:02+00:00 2026-05-26T05:47:02+00:00

I can’t set my h:selectOneMenu to submit immediately without validating other inputs. Here is

  • 0

I can’t set my h:selectOneMenu to submit immediately without validating other inputs. Here is the code:

<h:selectOneMenu value="#{a.avalue}" onchange="submit()" immediate="true">   
    <f:selectItems value="#{b.bvalue}" var="k" itemLabel="#{k.asdad}"  
        itemValue="#{k.asdad}"/>   
</h:selectOneMenu>   
<h:inputText id="sada" value="#{c.cvalue}" required="true"  
    requiredMessage="*asdadadadasd"  
    validatorMessage="*asdsadadadadad">   
    <f:validateLength maximum="80"/>   
</h:inputText>

When I change the menu value, the validators of other inputs still fire. How can I deny that?

  • 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-26T05:47:02+00:00Added an answer on May 26, 2026 at 5:47 am

    The immediate="true" on current input component doesn’t stop validators of other input components from firing. It only causes that the current input component will be validated one phase before than usual. Basically, you need to attach a valueChangeListener to the input component and then call FacesContext#renderResponse() in the listener method so that the processing of all other input components will be skipped.

    But as you’re already using JSF 2.0, much better/easier is to use ajax powers instead of this old fashioned JSF 1.x approach.

    E.g.

    <h:selectOneMenu value="#{bean.country}">
        <f:selectItems value="#{bean.countries}" var="country" itemLabel="#{country.name}" itemValue="#{country.code}"/>
        <f:ajax listener="#{bean.changeCountry}" />
    </h:selectOneMenu>   
    

    with

    public void changeCountry() {
        System.out.println("Selected country is: " + country);
    }
    

    If you’d like to re-render some parts of the form whenever the selection is changed, then use the render attribute. E.g.

        <f:ajax listener="#{bean.changeCountry}" render="otherComponentId" />
    

    See also:

    • When to use valueChangeListener or f:ajax listener?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody shed some light on getDay() in Javascript please. Here datepicker is textbox
Can anyone help me as what is going wrong here? Am not able to
Can i get the source code for a WAMP stack installer somewhere? Any help
Can somebody point me a good strategy for security crosscutting concern without AOP for
Can we put functions to determine the condition for our list comprehensions. Here is
Can you have submenus with the top level set to checkable in WPF? I
Can we close all known/unknown connections to database with the code? I'm using Access
Can anyone can confirm the best idea for storing jquery code, initially i was
Can someone explain the usage of the dollar sign here.. var updateProgressDiv = $get('updateProgressDiv');
Can we set the alpha of drawable for its disable state through XML? For

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.