Search code examples
javagwtuibinder

uibinder onload not call


if i call uibinder through new TheWidget(); is onLoad() method is call right after TheWidget() is instantiationed ?

public class TheWidget extends Composite {

}

in my test, onLoad() is not call


Solution

  • onLoad is called when your widget becomes attached to the browser document, not when it is constructed.

    Try adding your widget to another attached widget:

    TheWidget theWidget = new TheWidget();
    RootPanel.get().add(theWidget);