当在GWT和GWTP上调用新的Presenter时,它有一些在html加载完成后调用的方法吗?

Ber*_*ale 5 html gwt gwt-platform

我需要对div css做一些调整.但我无法在方法onBind()或onReveal()上执行此操作,因为调用此两个方法时不会加载html.

所以我想知道一些方法来自动调用一个方法,当我修改我的html(当一个Presenter被称为html必须修改,因为新的小部件将被添加)加载.

这是我必须调用的方法:

private void hidePopup(){
  $(".olLayerGooglePoweredBy, .olLayerGoogleV3, .gmnoprint").
    css(CSS.VISIBILITY.with
      (com.google.gwt.dom.client.Style.Visibility.HIDDEN));
}
Run Code Online (Sandbox Code Playgroud)

Col*_*rth 1

EntryPoint 方法onModuleLoad()就是该方法 - 当页面的其余部分加载时将调用该方法。GWT 的启动方式与大多数 JS 框架不同,您可以在页面仍在加载时编写 JS。相反,可以假设当onModuleLoad调用 时,页面的其余部分已经准备就绪。