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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:33:01+00:00 2026-06-18T15:33:01+00:00

I try to do something that is very similar to this richfaces example. I

  • 0

I try to do something that is very similar to this richfaces example. I have a form that describes custom ID validation in case that you have not selected one of the predefined ones, else the form will be disabled. So disabled expression for the form members would go to the next method:

public boolean isPredefinedValidator() {
    return !currentProjectRegField.getIdValidation().getIdType().equals(IdValidatorType.NONE);
}

that is invoked like this:

disabled="#{accountHome.isPredefinedValidator()}"

and here is the selector for the predefined validator:

<h:selectOneMenu value="#{accountHome.currentProjectRegField.idValidation.idType}"
    rendered="#{!(empty accountHome.currentProjectRegField or empty accountHome.currentProjectRegField.idValidation)}">
    <a4j:support event="onchange" reRender="customIdValidator"/>
        <s:convertEnum />
            <s:enumItem enumValue="NONE" label="#{messages['IdValidatorType_enum.NONE']}"/>
            <s:enumItem enumValue="USA_ID" label="#{messages['IdValidatorType_enum.USA_ID']}"/>
            <s:enumItem enumValue="MEXICO_ID" label="#{messages['IdValidatorType_enum.MEXICO_ID']}"/>
</h:selectOneMenu>

The issue is, when the method isPredefinedValidator() is invoked on a4j rerender (on disabled EL), I receive NPE.

Caused by: java.lang.NullPointerException
at com.whatever.something.action.AccountHome.isPredefinedValidator(AccountHome.java)

And when I try to debug – turns out that the value that has been set from the selectOneMenu is null.

Does it mean that reRender and setting value to the variable happens async, and there is a race condition? And what is the correct solution for this case?

  • 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-06-18T15:33:03+00:00Added an answer on June 18, 2026 at 3:33 pm

    Some black-magic configuration in the rich:modalPanel that contains the h:selectOneMenu resolved this issue. It goes like this <rich:modalPanel ... domElementAttachment="form">

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

Sidebar

Related Questions

I have a very specific problem in T-SQL. If I can solve this example
Is there a way to have an JUnit Rule or something similar that gives
I've came across something that drives me crazy. please help me :( I'm try
I'm try something from this comment idea Code Igniter Controller/Model name conflicts find class
I want to do something like this... try { # Something in this function
I have a situation where I have 4-5 very similar classes which I'd like
My question is very similar to this one: Getting an error in jQuery when
This maybe not possible but I thought I might just give it a try.
I have a validate method which seems pretty simple because I use something very
Can anyone give me an example of successful non-programmer, 5GL (not that I am

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.