I can understand that. I am going to hazard a guess that firing an
event and setting the value of the keycode to the TAB key likely is
only useful for any code that Handles such a keystroke... it won't
actually invoke the Tab keypress event in and of itself. Course, this
is just a guess, I don't know and I'm not going to spend the time
right now to try to do it myself. It is interesting and I would like
to know the truth myself, it just sucks how time is so rare, I wish I
had a lot more of it :(

Hopefully you can make the design so it can nicely keep track of what
widgets are where or just do a search to find the next one. I'm sure
you can do it without too much work.

gl :)

On Jun 14, 9:48 pm, Se Hee Lee <[email protected]> wrote:
> Thanks for your input.
>
> Yes. I know such solution works, but since the order of the widget isn't
> consistent and changes every time the screen is rendered, I need to perform
> some calculation to figure out the next widget with higher tab index to get
> focus.
>
> I was hoping that by firing a key press event with the tab, it would
> naturally position to the Focusable widget with next tab index
> automatically, in much simpler and concise manner.
>
>
>
>
>
> On Mon, Jun 14, 2010 at 9:50 PM, Sky <[email protected]> wrote:
> > Lex, here's a thought: can you determine which Widget or DOM element
> > that you want to gain focus when the user hits ENTER? If you can,
> > don't bother creating that event, just talk directly to the widget or
> > the DOM element through JSNI and give it focus. I don't know why your
> > solution doesn't work, but I think setting the focus on something is
> > the better approach. Not sure though for your specific situation.
>
> > gl
>
> > On Jun 14, 3:13 pm, Lex <[email protected]> wrote:
> > > 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 <[email protected]> wrote:
>
> > > > On May 4, 9:43 pm, Lukas Laag <[email protected]> wrote:
>
> > > > > It is possible to generate events programmatically in JavaScript.
> > This
> > > > > page gives a good overview of the topic, includingkeyevents (look
> > > > > for 'Manually firing events'):
>
> > > > >http://www.howtocreate.co.uk/tutorials/javascript/domevents.
>
> > > > > 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...
>
> > > > (note: according to "the web", it's a bug in WebKit)
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups "Google Web Toolkit" group.
> > > > To post to this group, send email to
> > [email protected].
> > > > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%2Bunsubs 
> > [email protected]>
> > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%2Bunsubs 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> "Everything should be made as simple as possible, but not simpler."
>
> - Albert Einstein

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to