Thomas is correct here. onAttach() performs some very important functions related to widget behavior, so if you are not careful (to call super.onAttach()) then you would end up with broken widgets if you override that method. It is useful to override onAttach() if you need to perform some task just to rendering then call super.onAttach() at the end of your overridden method.
However, onLoad() is the correct method to place your own code in if you need to perform tasks AFTER the widget is attached to DOM. -jason On Dec 11, 2008, at 4:32 AM, Thomas Broyer wrote: > > > > On 11 déc, 07:10, Adam T <[EMAIL PROTECTED]> wrote: >> Try overloading the onAttach() method of the widget/panel in question >> which are called as the widget is attached to the DOM, it might be >> wise to wrap your code that calls the getOffsetWidth() method up in a >> DeferredCommand. > > Widget.onLoad is called at the end of Widget.onAttach, i.e. when child > widgets have been attached. > I'd therefore rather use onLoad than onAttach in this case (though > they would work the same, given that OnLoad is called *from* > onAttach). > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---