In the widget lifecycle it starts with creation in the constructor, then injection into the DOM (attached), and then loaded. The UiBinder can call the constructor on its own, or you can pass it in (provided=true). Depending on what type of widget you're using (UiRenderer or UiBinder) the HTML string is created by GWT in the browser and then inserted into the destination node of the DOM. In some cases, where references are needed (i.e. UiField), temporary id's are inserted into the DOM and then removed to get this reference (why you can't us id's in UiBinder). Once all of this is complete the object is 'attached' and the eponymous event is fired. Then, directly after this onLoad() is fired. Later, when the widget is being removed, the detach event is fired.
The process is more complex than the above, but I hope if provides some clarity.
constructor
Object is created.
onAttach
This method is called when a widget is attached to the browser's document. To receive notification after a Widget has been added to the document, override the onLoad()
method.
onLoadThis method is called immediately after a widget becomes attached to the browser's document.
Sincerely,
Joseph