Reputation: 2524
I want to catch the onLoad
Event of TextBox
. But I am not finding any handler through which I can call it. GWT provides LoadHandler
for the same purpose. But I don't know how should I instantiate the Load Event from TextBox
.
Any help would be appreciable!!!
Upvotes: 1
Views: 328
Reputation: 1197
TextBox extends ValueBoxBase which has a protected method called onLoad().
All you have to do is the following
public class MyTextBox extends TextBox
{
@Override
protected void onLoad() {
//Do your stuff
}
}
Upvotes: 1
Reputation: 4780
textBox.addAttachHandler(new Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
if (event.isAttached()){
doMyOnLoadMethod();
}
}
});
Upvotes: -1
Reputation: 122026
It seems you are looking for addAttachHandler() .
If you are designing an custom textbox
implement the interface HasAttachHandlers .
Upvotes: 1