So everything I am finding in my search is how to do it in JS which I know how to do. What I am hoping to find is a GWT mechanism to do this.
What I am looking to do is put an alert window.alert(app.getStatus())
on a page after it loads (not hard). The issue is that with my current code the alert pops-up before the page finishes loading so the user sees a partially loaded white page that does nothing until the Ok button is clicked.
This is what I currently have
public class DisplayApplicationViewImpl extends Composite
implements DisplayApplicationView {
public DisplayApplicationViewImpl() {
/*...
Lot of logic that is not helpful
...*/
initWidget(uiBinder.createAndBindUi(this));
Window.alert("Test");
}
}
I have also attempted the below (although I do not think it is the correct use) but these only fire once, when an application is opened, and then will not fire on any other applications unless the page is refreshed and still has the load "issue".
Scheduler.get().scheduleFinally(new RepeatingCommand(){
@Override
public boolean execute() {
Window.alert("Test");
return false;
}
});
This one is mildly closer because it allows a loading gif to show but I am not sure why that is there is literally no change in that functionality just this code.
Scheduler.get().scheduleDeferred(new ScheduledCommand(){
@Override
public void execute() {
Window.alert("Test");
}
});
I have looked into 'Window.onload()' but that does not seem to be an option where I am.