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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:42:30+00:00 2026-05-25T15:42:30+00:00

I have this selectOneMenu that asks for something, the default value is empty, because

  • 0

I have this selectOneMenu that asks for something, the default value is empty, because people need to think about the question and actually needs to fill it in.

<h:selectOneMenu id="fileSecurity" value="#{flowScope.application.fileSecurity}" required="true" >  
    <f:selectItem itemLabel="" itemValue="" noSelectionOption="true"/>  
    <f:selectItem itemLabel="ja" itemValue="true" />  
    <f:selectItem itemLabel="nee" itemValue="false" />     
</h:selectOneMenu>

This is what i have, now when you fill in the empty value it gives: “managementTabs:ApplicationManagementForm:fileSecurity : Needs to be filled in.”
wich is correct.

When i click yes or the true value it accepts the anwser.

But when i click no or false it gives:
“managementTabs:ApplicationManagementForm:fileSecurity: Validation Error: Value is not valid”

  • Why does Jsf2.0 only accept true as the valid awnser and not false?
  • Is there a way around this? Or do i have to write a custom validator?
  • 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-25T15:42:31+00:00Added an answer on May 25, 2026 at 3:42 pm

    It seems that a submitted value of false is conflicting with the empty string value of noSelectionOption in some way. The following entries for the 1st item works fine:

    <f:selectItem itemLabel="" itemValue="" />  
    

    and

    <f:selectItem itemLabel="" noSelectionOption="true" />
    

    and

    <f:selectItem itemLabel="" itemValue="#{null}" noSelectionOption="true" />
    

    I only don’t understand why. It’s illogical. To find the real answer, I would need to run the debugger.


    Update: I debugged and found the culprit in the SelectUtils#valueIsNoSelectionOption() (Mojarra). The empty string of the noSelectionOption get coerced to boolean false instead of Boolean null and hence the comparison with the submitted value is valid and hence the selected value is invalid. This is “by design”. You really need to explicitly specify an itemValue="#{null}".

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

Sidebar

Related Questions

I have a selectOneMenu that displays some different stuff categories: <h:selectOneMenu value=#{searchController.selectedCategory}> <f:selectItems value=#{searchController.formatedCategories()}
I have a <h:selectOneMenu> that renders the value of the cardStatus from my object
From this previously asked question , I have noticed that when I move a
I have this code in jQuery, that I want to reimplement with the prototype
I have this idea for a free backup application. The largest problem I need
I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The
I have this line in a useful Bash script that I haven't managed to
Hi I have the follonwing selectOneMenu <h:selectOneMenu value=#{modelsController.selected.idBrands}> <f:selectItems value={brandsController.itemsAvailableSelectOne} /> </h:selectOneMenu> <br/> which
I have a IceFaces-form and several input fields. Let's say I have this: <ice:selectOneMenu
I want to have multiple <h:selectOneMenu> that are displayed by selection of main <h:selectOneMenu>

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.