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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:09:26+00:00 2026-06-15T14:09:26+00:00

I have a ComboBox, where as user types the values are loaded from a

  • 0

I have a ComboBox, where as user types the values are loaded from a webservice. If no values are found, I want to reset the combobox to empty value. An example with fixed 2 items without using webservice:

ComboBox comboBox = new ComboBox();
comboBox.addItem("First item");
comboBox.addItem("Second item");
comboBox.setNullSelectionAllowed(true);
comboBox.setInputPrompt("Select an item:");
comboBox.select("First item");

When I tried typing in input prompt “third” and then click away to loose focus, the “First item” stays selected.

When I tried to override this behaviour by manually calling comboBox.select(null) or comboBox.select("") or even comboBox.setValue(null), still the “First item” stays selected.
 
This sound like a comboBox bug to me, but maybe somebody knows a workaround.

  • 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-15T14:09:27+00:00Added an answer on June 15, 2026 at 2:09 pm

    As quick solution you can use this code. Simply add empty element into your combo box and on blur, or what ever action you needed, select it.

    final ComboBox comboBox = new ComboBox();
    comboBox.addItem("");
    comboBox.setNullSelectionItemId(comboBox.getItem(""));
    
    comboBox.addItem("First item");
    comboBox.addItem("Second item");
    comboBox.setNullSelectionAllowed(true);
    comboBox.setInputPrompt("Select an item:");
    comboBox.select("First item");
    
    comboBox.addListener(new BlurListener() {
    
    @Override
    public void blur(final BlurEvent event) {
            comboBox.setValue("");
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a combobox for a web page. It takes values from user
I have a combobox whose value I want to use with a SQL WHERE
I want to make a ComboBox where the user can type an integer value
I have a remote combobox that allows filtering as the user types into it.
I have a user control with a combobox, and so I can edit its
I have a read only combo-box with 5 values in, when the user selects
i have combobox in datagrid (sourse in mysql (web)) how i can get value
I have a combobox in a WPF Window, it is filled with usernames from
I have a combobox in a form and a button. I want to add
I have a simple DataGrid which I want the user to add some rows

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.