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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:35:05+00:00 2026-05-27T03:35:05+00:00

A bit of context: I’ve been playing with uiBinder recently in an attempt to

  • 0

A bit of context: I’ve been playing with uiBinder recently in an attempt to improve our approach to layout and reduce the number of Widgets our code relies on. As part of that, I’m trying to use HTML as opposed to Widgets as much as possible, and I decided to test event bubbling to dispatch child events to a parent widget where possible.

I proceeded to attach a Dom event handler to my parent widget, with the idea to handle events based on the type of html element that sourced the event which I would test for using instanceof.

My uiBinder code looks like this:

<g:HTMLPanel>
  <table>
    <tr>
      <td><input type="text" ui:field = "input0"/></td>
    </tr>
  </table>
<div>Click Me please</div>
</g:HTMLPanel>

And the class implementation:

public class MyWidget extends Composite {
  private static MyWidgetUiBinder uiBinder = GWT.create(MyWidgetUiBinder.class);
  interface MyWidgetUiBinder extends UiBinder<Widget, MyWidget> {}
  @UiField
  InputElement input0;
  public MyWidget() {
    initWidget(uiBinder.createAndBindUi(this));
    super.addDomHandler(new ClickHandler(){

      @Override
      public void onClick(ClickEvent event) {
        System.out.print("Hi");
        Element el = Element.as(event.getNativeEvent().getEventTarget());
        if(el instanceof InputElement){
          Window.alert("It is an INPUT ELEMENT");
        }
        if(el instanceof SpanElement){
          Window.alert("It is a SPAN!");
        }
        if(el instanceof DivElement){
          Window.alert("NO, it is a DIV!!!");
        }
      }
    }, ClickEvent.getType());
}

Now, what happens when I display on MyWidget is something I cannot understand. A click to both the text box and the div, or anywhere within the region of MyWidget results in ALL of the conditions in the click handler to be satisfied. All window alerts show up.

What’s the reason for this, and how can I work around this issue? It must be something within GWT and the way it maps to HTML elements.

Thanks!

  • 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-27T03:35:06+00:00Added an answer on May 27, 2026 at 3:35 am

    This is due to use of overlay types in the GWT/DOM mapping.

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

Sidebar

Related Questions

A bit of context is probably necessary first, Basically I've been using the VS2008
First, a bit of context: web.xml: I match all /app/* requests to my dispatcher:
Execution Context nested Events Hi, I would like to know a little bit more
At the moment we set content-type in our responce headers, a bit like this...
First, a little bit of context to explain why I am on the UDP
I'm a bit confused about how facebook.logout(context) works. Because even after calling log out,
I need to outline a little bit of background info for context. Please bear
I know about passing the context to templates, but I am bit confused with
I have first to explain a little bit my context, then the question: I
I thought I'd rewrite this and add a bit of context (more so it'll

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.