How to configure and / or handle the onload event using GWT

This should be a fairly simple question, but I can’t find anything through Google or this site about how to do this, and it really upsets because I went through the GWT tutorial.

I am trying to convert a javascript project that I have for GWT. Right now I'm trying to convert "" to the equivalent of GWT. I looked at the RootPanel and can’t see anything.

Obviously, I missed something fundamental in GWT ?!

+6
events gwt
source share
1 answer

Most widgets and panels in GWT implement the HasAttachHandlers interface. Adding AttachEvent.Handler to these widgets / panels is equivalent to defining a function to run onload.

Example:

FlowPanel mainPanel = new FlowPanel(); mainPanel.addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) { // do something } }); 
+13
source share

All Articles