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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:00:12+00:00 2026-06-01T23:00:12+00:00

How to implement a GWT ValueListBox inside an Editor with a specific list of

  • 0

How to implement a GWT ValueListBox inside an Editor with a specific list of objects, my code:

...
@UiField(provided = true)
@Path("address.countryCode")
ValueListBox<Country> countries = new ValueListBox<Country>(
        new Renderer<Country>() {

            @Override
            public String render(Country object) {
                return object.getCountryName();
            }

            @Override
            public void render(Country object, Appendable appendable)
                    throws IOException {
                render(object);
            }
        },          
        new ProvidesKey<Country>() {
            @Override
            public Object getKey(Country item) {
                return item.getCountryCode();
            }

        });
...

The Country class

public class Country  {
    private String countryName;
    private String countryCode;
}

But, during the GWT compilation I’m getting this error:

Type mismatch: cannot convert from String to Country
  • 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-01T23:00:14+00:00Added an answer on June 1, 2026 at 11:00 pm

    The problem is that you are trying to edit the address.countryCode (looking at the path annotation) with editor for Country.
    To make this work, you should change the path to address.country and do the assignment of the address.countryCode after editorDriver.flash(). Something like:

    Address address = editorDriver.flush();
    address.setCountryCode(address.getCountry().getCountryCode());
    

    To support this, the Address class should have the Country object as property.

    You may have assumed that the ValueListBox will work like classical select where the key is assigned to the property. Here the whole object is assigned. So in your case Country object can not be assigned to address.countryCode and vice-versa.

    Btw. you can correct the renderer (like the code below) and take care of null objects as arguments in the Renderer and Key Provider.

    new Renderer<Country>() {
    ...
                @Override
                public void render(Country object, Appendable appendable)
                        throws IOException {
                    appendable.append(render(object));
                }
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm puzzled about how to use GWT's ValueListBox with an Editor. I'm getting this
I'm investigating using gwt-dnd to implement drag-and-drop reordering of a list of widgets. The
I'm using gwt-platform and tried to implement GWT's editor framework. But I don't get
I´ve just started learning GWT and I´m trying to implement http://gwt.google.com/samples/Showcase/Showcase.html#!CwFileUpload and but failing
gwt Comet easier to implement on jetty or tomcat?
I implement an app with some list of process IDs. I used Runtime.getRuntime().exec(ps) to
I created an GWT project in eclipse. Now I tried to implement openId with
I usually use GWT WindowBuilder editor to design my GWT application UI, however I
I'm using Google Web Toolkit (GWT) to implement a complex application on the web.
I'm trying to implement an ejb-call by using JNDI-naming. Setup: JBoss-6.1.0.Final ear-deploy: gwt.war ejb.jar

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.