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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:33:15+00:00 2026-05-16T04:33:15+00:00

I started to look into using GWT in combination with UiBuilder. I’m a bit

  • 0

I started to look into using GWT in combination with UiBuilder. I’m a bit puzzled about how you can use the @UiHandler(..) directive to make simple event handle code as written down in the GWT documentation:

@UiHandler("button")
void handleClick(ClickEvent e) {
  Window.alert("Hello, AJAX");
}

In this case the method handleClick is used.
How do you know for each GWT widget what methods can be created with @UiHandler? For some you can also create a doClose() method.

But what can you use with, for instance, a ListBox to get an event an item is selected? Where in the documentation can I see this?

  • 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-16T04:33:15+00:00Added an answer on May 16, 2026 at 4:33 am

    The parameter you pass to the @UiHandler annotation is the name of the appropriate field you want to assign that *Handler. So, in this case you are assigning a ClickHandler to a Button button (actually, we just know the field’s name).

    As for how this exactly works – it’s part of GWT magic 🙂 My guess is that, just like any other UiBinder related code (I think there was a presentation on Google IO, that showed the code that UiBinder generates), at compilation time the compiler figures out what goes where. In this example: we have a Button button, and we have a @UiHandler annotated method that has a ClickEvent parameter -> that must mean it’s a ClickHandler (notice that the method’s name doesn’t matter). So let’s add some code at compile time (in the constructor, probably) that adds that handler to the button. If you are interested in a more comprehensive answer – check out the source 😀

    But what can you use with, for
    instance, a ListBox to get an event
    an item is selected? Where in the
    documentation can I see this?

    In the GWT API reference. In this case, you are probably looking for ListBox.addChangeHandler. But you usually won’t find @UiHandler related code there – that’s because it would be redundant – you always construct the @UiHandler methods the same way:

    1. You check the *Handler that you want to add, say ChangeHandler
    2. It has a void onChange(ChangeEvent event) – so, your method needs a ChangeEvent parameter and should look like this:

      @UiHandler("listBox")
      void whateverName(ChangeEvent event) {
          // ...
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've started looking into using Knockout for my team's use; I've been very pleased
I've recently started using Ruby and was told to look into using RVM. I'm
I have started to look into python and am trying to grasp new things
I've just started using google charts and want to use it in a small
I started using jQuery as soon as I found out about it, it is
I've started to look into the whole unit testing/test-driven development idea, and the more
When I started to look for the benefits of polymorphism, I found with this
When I first started looking at Scala, I liked the look of for-comprehensions. They
Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever
I started using EF 4.1 code first. I have a entity table like this:

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.