onLoad method of Composite is not called.

38 views
Skip to first unread message

Azade Khaladj

unread,
Jul 13, 2016, 7:16:38 PM7/13/16
to GWT Users
Hello all,

I have a class that extends Composite. I want to do some action when the component is loaded. The class implements the HasLoadHandlers and a LoadHandler is defined and added to the component.


The problem is that the onLoad method is never called.

Am I missing something?

Thanks

Jens

unread,
Jul 13, 2016, 7:42:57 PM7/13/16
to GWT Users
The LoadEvent is a native browser event that will be fired once the browser has downloaded some resources. So it does not apply to a GWT widget. But every GWT widget (and thus Composite as well) has a protected onLoad / onUnload method that you can override to execute code once the widget has been attached/detached to/from the DOM.

-- J.
Reply all
Reply to author
Forward
0 new messages