Here is the correct working version based on logans answer. I added the instance variable which is needed because the myOnload() method is non-static. I also added the $entry() function to track error in GWT.
class MyClass{
MyClass(){
expose();
// UiBinder stuff here
}
// Call this once. Exports your Java method as a javascript method
public native void expose()/*-{
var instance = this;
$wnd.myOnLoadThing = $entry(function(){
instance.@com.my.MyClass::myOnload()();
});
}-*/;
public void myOnload(){
// Put your java onload function here
};
}
And in your uiBinder, make sure to call that myOnLoadThing
<g:HTMLPanel>
<div class="fb-login-button" data-max-rows="1" data-size="xlarge"
data-show-faces="false" data-auto-logout-link="false"
data-scope="email,publish_actions,user_birthday,user_likes"
onlogin="window.myOnLoadThing();"></div>
</g:HTMLPanel>
There's also a good answer here: How to call GWT java function from Javascript?