I'm now using a div rather than form tag to wrap the textbox and it seems to have fixed the problem. Thanks!
On Wed, Apr 14, 2010 at 8:28 PM, Sripathi Krishnan < sripathikrish...@gmail.com> wrote: > Is the textbox a part of a form that has a submit button? When you press > enter, the form may be submitting, causing the page to reload (and therefore > calling onModuleLoad). > > > --Sri > > > On 15 April 2010 00:04, Daniel Simons <daniel.simo...@gmail.com> wrote: > >> In my app I have a View which implements the KeyUpHandler. Within the >> view I have a TextBox for which I have added the key up event handler. My >> view summarized looks something like this: >> >> >> public class View extends Composite implements KeyUpHandler >> { >> public View() >> { >> textbox.addKeyUpHandler(this); >> } >> >> @Override >> public void onKeyUp(KeyUpEvent event) { >> if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { >> Window.alert("Enter was pressed"); >> keyPressButton.click(); >> } >> } >> >> } >> >> My problem is that when I click the ENTER key while focus is on the >> textbox, the onmodule method is called reinitializing everything....How do I >> avoid this? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to google-web-tool...@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://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 google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.