You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ocean ocean <ri...@gmail.com> on 2010/11/21 21:59:06 UTC

Default Button on Forms

Hey all,

Is it possible to assign a default button/action on forms? For example, in
most Swing or RCP applications, hitting Ctrl-Enter will automatically
trigger the 'OK' button and submit the form. Is this possible in pivot-land?

Re: Default Button on Forms

Posted by Greg Brown <gk...@mac.com>.
A tooltip is a good idea. You might also use a different color for the default button, or some other visual distinction.

On Nov 22, 2010, at 1:00 AM, ocean ocean wrote:

> Greg,
> 
> Ok, this makes sense. Should I also set a tooltip on the button itself so the user might know that hitting ctrl-enter will trigger the 'ok' button. Is there anything else that might be done to provide some sort of visual indicator...?
> 
> On Sun, Nov 21, 2010 at 6:55 PM, Greg Brown <gk...@mac.com> wrote:
> > Is there no way to assign a kind of 'form-wide' keyboard binding?
> 
> You can just attach a ComponentKeyListener to the form itself. That will receive all key events that haven't been consumed by child components.
> 
> 
> 
> 


Re: Default Button on Forms

Posted by ocean ocean <ri...@gmail.com>.
Greg,

Ok, this makes sense. Should I also set a tooltip on the button itself so
the user might know that hitting ctrl-enter will trigger the 'ok' button. Is
there anything else that might be done to provide some sort of visual
indicator...?

On Sun, Nov 21, 2010 at 6:55 PM, Greg Brown <gk...@mac.com> wrote:

> > Is there no way to assign a kind of 'form-wide' keyboard binding?
>
> You can just attach a ComponentKeyListener to the form itself. That will
> receive all key events that haven't been consumed by child components.
>
>
>
>

Re: Default Button on Forms

Posted by Greg Brown <gk...@mac.com>.
> Is there no way to assign a kind of 'form-wide' keyboard binding? 

You can just attach a ComponentKeyListener to the form itself. That will receive all key events that haven't been consumed by child components.




Re: Default Button on Forms

Posted by ocean ocean <ri...@gmail.com>.
Hey Greg,

I mean from a UI perspective, a default button/action is simply a keyboard
binding triggered by 'ctrl-enter'. Usually in most applications this is the
same as hitting the ok button. Is there no way to assign a kind of
'form-wide' keyboard binding? (Sorry if I'm missing something obvious but I
don't see how this is possible without assigning the listener to the entire
window...)

On Sun, Nov 21, 2010 at 4:21 PM, Greg Brown <gk...@mac.com> wrote:

> No - Pivot doesn't have any concept of a "default button", nor does it have
> any notion of "submitting a form". In a Java application, form submission
> can be handled in any number of ways (e.g. it's not always an HTTP POST to
> the server), so we have intentionally left this to the application
> developer.
>
> G
>
> On Nov 21, 2010, at 3:59 PM, ocean ocean wrote:
>
> > Hey all,
> >
> > Is it possible to assign a default button/action on forms? For example,
> in most Swing or RCP applications, hitting Ctrl-Enter will automatically
> trigger the 'OK' button and submit the form. Is this possible in pivot-land?
>
>

Re: Default Button on Forms

Posted by Greg Brown <gk...@mac.com>.
No - Pivot doesn't have any concept of a "default button", nor does it have any notion of "submitting a form". In a Java application, form submission can be handled in any number of ways (e.g. it's not always an HTTP POST to the server), so we have intentionally left this to the application developer.

G

On Nov 21, 2010, at 3:59 PM, ocean ocean wrote:

> Hey all,
> 
> Is it possible to assign a default button/action on forms? For example, in most Swing or RCP applications, hitting Ctrl-Enter will automatically trigger the 'OK' button and submit the form. Is this possible in pivot-land?