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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:25:16+00:00 2026-06-06T10:25:16+00:00

I am new to GWT. I am writing a simple GWT program where I

  • 0

I am new to GWT. I am writing a simple GWT program where I need to use a combo box for which I used an instance of ValueListBox . In that combo, I need to list out the numbers from 1 to 12 representing the months of a year. But the combo appends null value at the end. Can anyone please help me how to remove that null value ?

    final ValueListBox<Integer> monthCombo = new ValueListBox<Integer>(new Renderer<Integer>() {

            @Override
            public String render(Integer object) {
                return String.valueOf(object);
            }

            @Override
            public void render(Integer object, Appendable appendable) throws IOException {
                if (object != null) {

                    String value = render(object);
                    appendable.append(value);
                }
            }
        });
    monthCombo.setAcceptableValues(getMonthList());
    monthCombo.setValue(1);

    private List<Integer> getMonthList() {
        List<Integer> list = new ArrayList<Integer>();

        for (int i = 1; i <= 12; i++) {
            list.add(i);
        }

        return list;
    }

enter image description here

  • 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-06T10:25:18+00:00Added an answer on June 6, 2026 at 10:25 am

    Call setValue before setAcceptableValues.

    The reason is that the value is null when you call setAcceptableValues, and ValueListBox automatically adds any value (generally passed to setValue) to the list of acceptable values (so that the value is actually set, and can be selected by the user, and re-selected if she selected another value and wants to go back to the original one). Calling setValue first with a value that will be in the list of acceptable values negates this side-effect.

    See http://code.google.com/p/google-web-toolkit/issues/detail?id=5477

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

Sidebar

Related Questions

I am new to GWT. I am writing a simple GWT program where I
I'm writing a simple Google Web Toolkit service which acts as a proxy, which
Does anyone have experience writing a Facebook application using GWT with GAE? I'm new
I am writing a GWT app that involves interacting with an external document in
I'm new to GWT and RequestFactory so I'm coding a simple test app using
I'm currently writing a pure GWT (2.3) application and I require the use of
I am writing an application in GWT and I need to detect when a
I'm trying to create a new GWT project, and want to use the GWT
I am writing an application that uses GWT, some Spring MVC and Spring Security.
Im new to gwt programming and I'm having an error that I can't solve.

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.