I am facing problem to get text on ONPASTE event. Suppose i have 5 textboxes and i am using sinkEvent then how would i get the text which going to be pasted in any of the textbox
public abc() {
super();
TextBox t1 = new TextBox();
TextBox t2 = new TextBox();
TextBox t3 = new TextBox();
TextBox t4 = new TextBox();
TextBox t5 = new TextBox();
sinkEvents( Event.ONPASTE );
}
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent( event );
switch (DOM.eventGetType(event)) {
case Event.ONPASTE:
//Now here i want to read get the text which is going to be
//pasted in the any of the textbox
}
}
you have to catch the event in the textbox itself. you could extend the textbox to fire an event on onpaste event or do it quick and dirty like this: