Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It has some method to call after html load is complete when a new Presenter is called on GWT and GWTP?

I need to make some adjustment on a div css. But I can't do this on method onBind() or onReveal() because the html isn't loaded when this two method is called.

So I was wondering some way to automatically call a method right when the modification of my html(When a Presenter is called the html has to modify because new widgets will be add) load.

This is the method that I have to call:

private void hidePopup(){
  $(".olLayerGooglePoweredBy, .olLayerGoogleV3, .gmnoprint").
    css(CSS.VISIBILITY.with
      (com.google.gwt.dom.client.Style.Visibility.HIDDEN));
}
like image 761
Bernardo Vale Avatar asked Oct 22 '22 19:10

Bernardo Vale


2 Answers

I'm not sure I fully understand your question, but it seems to me like you are looking for a way to know when a widget has been added to the DOM.

If that is the case, I think the onLoad() method might be what you're looking for: http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/user/client/ui/Widget.html#onLoad%28%29

like image 182
Shiv16 Avatar answered Oct 29 '22 13:10

Shiv16


The EntryPoint method onModuleLoad() is that method - this will be called when the rest of the page has loaded. GWT doesn't start up quite like most JS frameworks, where you can write JS while the page is still loading. Instead, it can be assumed that when onModuleLoad is invoked, the rest of the page is already ready to go.

like image 44
Colin Alworth Avatar answered Oct 29 '22 13:10

Colin Alworth