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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:57:56+00:00 2026-06-14T13:57:56+00:00

In my application, every Foo has a Category. Foo.Category is an internal enum in

  • 0

In my application, every Foo has a Category. Foo.Category is an internal enum in class Foo. When creating a Foo on its given form page, the user selects a Category from a drop down typed to the enum. However, this choice is optional.

Now, on another page, I want to be able to search Foo by name, and also by Category. This search form has a CheckBoxMultipleChoice<Foo.Category> also typed to the same internal enum. The checked values are sent to a DAO which queries my database with a “where category in” clause.

I want to add a “Blank/ None” choice to the check boxes, so that when sent to the DAO I can add a “or where category is null” to the query, if checked. Since my check box is typed to the enum, is this even possible?

EDIT: Not sure if this will be important, but my enum has values designated by a SHORTNAME, but each has a String LongerAndMoreDescriptiveName, and the enum overrides toString() to return this value. The SHORTNAME is what I store in the database, and used in the where clauses, but the Longer is what is shown on the UI. I had briefly thought about changing to CheckBoxMultipleChoice and add the blank choice, but how would I then solve the discrepancy between values?

  • 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-14T13:57:57+00:00Added an answer on June 14, 2026 at 1:57 pm

    It’s not possible directly. There’s no such thing as “No value” choice in CheckBoxMultipleChoice (like in DropDownChoice), because component’s model is null when nothing is selected.

    I think, you have two options:

    1) Add constant Category.NONE to Foo.Category enum, and process it accordingly in the drop down choice where user selects category.

    2) Create a wrapper class (something like Optional<Foo.Category>) for Foo.Category constants, and use it in the CheckBoxMultipleChoice instead of using Foo.Category constants directly. Instance of Optional<Foo.Category> will be able to have or not have corresponding Foo.Category constant so your processing of selection model should be appropriate.

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

Sidebar

Related Questions

I have an application where every single page uses a set of data that
i'm trying to build an application that every given time, will connect to a
I've got this flow on an enterprise application: on every service page there is
I was working on creating some tables in database foo , but every time
Every Windows developer is all too familiar with an alert of the form: Foo.exe
Currently, each web service for our application has a user parameter that is added
I want to publish a beta version of my application every time it builds,
I need to perform the follow logic in my application: Every minute, I want
On my machine, I have a file which is regenerated by an application every
I have an application and every new created activity will start an async task

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.