Click even on outer HTMLPanel on existing html ?

76 views
Skip to first unread message

Ed

unread,
Jan 10, 2016, 5:18:17 AM1/10/16
to GWT Users
I load a piece of html from an external file and add wrap it in a HTMLPanel, and add a ClickHandler to the HTMLPanel to catch click events anywhere on the loaded html. However, that doesn't work, I not catch any click event :(

The click handler is added as  Dom handler.

However, if I add a TextBox, the click handler will receive clicks made on the added TextBox. So event do bubble up on new widgets that are added, but not on existing html.

I thought it might be because of bootstrap css that I use (container, row and col styles), but removing them had no effect.
The HTMLPanel has a background color and is wrapping all loaded html.

How to solve this?

- Ed


Ed

unread,
Jan 12, 2016, 5:53:03 AM1/12/16
to GWT Users
Please some advice on this issue ?

Ed

unread,
Jan 26, 2016, 4:00:20 PM1/26/16
to GWT Users
Can somebody please give me some tips on how to solve this ?
How to get the click events on the outer div html, loaded in an HTMLPanel?
Thank you, Ed

Vassilis Virvilis

unread,
Jan 26, 2016, 4:03:17 PM1/26/16
to google-we...@googlegroups.com
stupid suggestion but do you sink the events you want to listen for?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.



--
Vassilis Virvilis

Ed Bras

unread,
Jan 26, 2016, 5:24:05 PM1/26/16
to google-we...@googlegroups.com
Yes I do (as DomHandler: ClickEvent.getType()) that's why I don't understand I don't catch any.
I get the idea the events aren't bubbled up (passed through), because the loaded html in the HTMLPanel exists of existing html instead of creating it through gwt, such that events are passed through...


--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/60RGI3WN1W0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Jens

unread,
Jan 26, 2016, 5:31:34 PM1/26/16
to GWT Users

stupid suggestion but do you sink the events you want to listen for?

addDomHandler() automatically sinks the corresponding native event type. You only need to sink events yourself when you override onBrowserEvent() to handle native events without registering a handler using addDomHandler().

I know that HTMLPanel.addDomHandler(ClickHandler, ClickEvent.getType()) works as expected as our app uses it. However it does not use HTMLPanel.wrap().

-- J.

Ed Bras

unread,
Jan 26, 2016, 6:53:23 PM1/26/16
to google-we...@googlegroups.com
Hmmm,, so it should work for existing html, that is loaded from an xml file (so no wrap is needed).


--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/60RGI3WN1W0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages