Hi Jeff,

You've got things backwards for my concerns.  I want to fire off a
Submit event when the user hits Enter, I don't want to do something
special once the user has clicked on the button.

To do that, I need to figure out how to catch a KeyPress Event when
the last thing selected was a FileUpload (which doesn't have a
KeyPress Event Handler).  Any ideas?

As for using UIBinder:
1: I'm building the UI, and I'm a programmer. I LIKE building the UI
programmatically.
2: When I looked at it (July - August 2010), the documentation was
opaque, and singularly lacking in useful examples.  So avoiding
UIBuilder is faster than using it.
3: I build WebApps where the height and width of the UI is dependent
upon the data returned in response to user actions.  Which means that
the *LayoutPanels are a HUGE step backward in functionality for me.
To the extent that when I have to choose between "upgrading" GWT, and
losing the non-Layout Panels, I'll probably stop upgrading GWT.  (Yes,
I know that the change was a deliberate choice.  I just think it was a
horrible mistake.)

Greg

On Jan 4, 10:49 am, Jeff Schwartz <[email protected]> wrote:
> Using UiBinder declare a SubmitButton 
> (http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/g...)
> within a qwt FormPannel. If you want to react to the user submitting the
> form then assign a field name to the submit button and attach an event
> handler to the submit button. The following is an example of how to setup
> the event handler code when using UiBinder:
>
> @UiHandler("yourButtonFieldName")
> void onSubmitBtnClicked(ClickEvent e) {
>     doSomething();
>
> }
>
> On Tue, Jan 4, 2011 at 10:36 AM, Greg Dougherty
> <[email protected]>wrote:
>
>
>
> > Hi Jeff,
>
> > I don't see any place to attach a KeyPressHandler to a FormPanel.
> > Were you thinking of something else?
>
> > Greg
>
> > On Jan 3, 6:27 pm, Jeff Schwartz <[email protected]> wrote:
> > > I haven't tried it but I think if you wrap your input widgets in a gwt
> > form
> > > widget your button would respond appropriately.
>
> > > On Mon, Jan 3, 2011 at 9:57 AM, Greg Dougherty
> > > <[email protected]>wrote:
>
> > > > I have a couple of places where I want the user to be able to hit
> > > > enter, and have a button clicked.  So I created the class EnterButton,
> > > > which has all the default constructors, and the following bit of code:
>
> > > >        public void onKeyPress (KeyPressEvent event)
> > > >        {
> > > >                int     keyCode = event.getNativeEvent ().getKeyCode
> > > > ();
>
> > > >                if (keyCode == KeyCodes.KEY_ENTER)
> > > >                        click ();
> > > >        }
>
> > > > Is there a reason why some such class isn't part of GWT already?  Is
> > > > there something in this code that will turn around and bite me in the
> > > > tush?
>
> > > > --
> > > > 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%[email protected]>
> > <google-web-toolkit%[email protected]<google-web-toolkit%[email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > > --
> > > *Jeff Schwartz*
>
> > --
> > 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%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> *Jeff Schwartz*

-- 
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