I have a question related to this.
I have a KeyPressHandler in the TextBox. When the user presses
"Enter", I want to simulate it as "Tab".
I have added the necessary code to capture the 'Enter" event, and then
I fire the new event using the DomEvent.fireNativeEvent.
NativeEvent tabEvent = Document.get().createKeyPressEvent(false,
false, false, false, 9, 9);
DomEvent.fireNativeEvent(tabEvent, textBox);
What I am hoping to see is the 'tabbing' of the current cursor to the
next Focusable widget, but it doesn't seem to happen.
What am I missing?
It basically re-enteres the KeyPressHandler since this is the widget
that is being fired. In short, I need the way to suppress the current
KeyPressHandler and have the Browser level KeyPressHandler of the
'tabbing' to occur.
Any help is appreciated.
Regards
On May 5, 11:01 am, Thomas Broyer <
t.bro...@gmail.com> wrote:
> On May 4, 9:43 pm, Lukas Laag <
laa...@gmail.com> wrote:
>
> > It is possible to generate events programmatically in JavaScript. This
> > page gives a good overview of the topic, includingkeyevents (look
> > I do not know if generating atabevent like this in a JSNI method
>
> you actually don't need JSNI: just use Document.get().createXxxEvent()
> and DomEvent.fireNativeEvent().
>
> > would solve your focus problem.
>
> I doubt it would, otherwise people would have proposed it as a
> workaround:
http://stackoverflow.com/questions/2398528/set-textbox-focus-in-mobil...