You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by "Roger L. Whitcomb" <Ro...@ingres.com> on 2011/06/21 02:24:54 UTC

Focus transfer when suggestion popup closes

I see that if I TAB off a TextInput field with a SuggestionPopup
attached, that the operation of the "keyPressed" listener tries to shift
focus to the next component, but that the "suggestionPopupClosed"
listener then tries to put the focus back on the TextInput.  Thus, the
focus moves for a split second and then moves back.  

 

So, I'm wondering why the latter occurs?  I can see maybe having an
attribute to determine that or just allowing the move always or
conditionally allowing the move if the result is "true", or ....

 

What seems right to do?  Right now I would say it is not right what it
does.

 

Thanks.

 

Roger Whitcomb

Architect, Engineering

Ingres Corporation

roger.whitcomb@ingres.com <ma...@ingres.com> 

 

PHONE +1 650.587.5596

FAX +1 650.587.5550

 

www.ingres.com <http://www.ingres.com/>  

 

This transmission is confidential and intended solely for the use of the
recipient named above. It may contain confidential, proprietary, or
legally privileged information. If you are not the intended recipient,
you are hereby notified that any unauthorized review, use, disclosure or
distribution is strictly prohibited. If you have received this
transmission in error, please contact the sender by reply e-mail and
delete the original transmission and all copies from your system.

 


RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
My lists are generally not very long, so Panorama seems fine to me.  I
also notice that things like Firefox tab popup list is pretty much like
a Panorama and so is its Bookmarks menu (when it gets longer than the
screen size).  So we are not without precedent.  I think I slightly
prefer the minimally intrusive look of the Panorama, rather than having
full-blown scroll bars.  

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 12:33 PM
To: dev@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

Roger,

While on the subject of SuggestionPopups - do you have any opinion on
this
old thread?

http://apache-pivot-developers.417237.n3.nabble.com/SuggestionPopup-Pano
rama-vs-ScrollPane-tp2013809p2013809.html

Chris

On 22 June 2011 02:21, Roger L. Whitcomb <Ro...@ingres.com>
wrote:

> Sounds good.  Yeah, I was just "focused" on SuggestionPopup 'cause
> that's what I've been working on, but there are other issues, as you
> noticed.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
>
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 12:08 PM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
> I noticed a couple of other inconsistencies/gripes earlier when
> comparing
> behaviour of all Components that I could think of which create 'pop up
> windows' of one kind or another.
>
> CalendarButton
> ColorChooserButton
> ListButton
> MenuButton
> SuggestionPopup
>
> Mainly just focus navigation, but also general keyboard navigation.
>
> I'll add these to a JIRA ticket soon and possibly link them with
> PIVOT-762
> to bundle them together.
>
>
> On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com>
> wrote:
>
> > Chris,
> >        The patch is already attached to the JIRA ticket.  Thanks.
> >
> > Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com
|
> > Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063
|
> > USA  +1 650-587-5596 | fax: +1 650-587-5550
> > -----Original Message-----
> > From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> > Sent: Tuesday, June 21, 2011 11:52 AM
> > To: dev@pivot.apache.org
> > Subject: Re: Focus transfer when suggestion popup closes
> >
> >  Roger,
> >
> > I think the mailing list accepts zipped patches if you want to try
> again
> > (as
> > the inline one came out garbled in GMail).
> >
> > But now that you have created a JIRA ticket, it might be easier to
> just
> > attacy the patch there for review.
> >
> > I'll take a look tomorrow if not before.
> >
> > Chris
> >
>

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
Roger,

While on the subject of SuggestionPopups - do you have any opinion on this
old thread?

http://apache-pivot-developers.417237.n3.nabble.com/SuggestionPopup-Panorama-vs-ScrollPane-tp2013809p2013809.html

Chris

On 22 June 2011 02:21, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> Sounds good.  Yeah, I was just "focused" on SuggestionPopup 'cause
> that's what I've been working on, but there are other issues, as you
> noticed.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
>
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 12:08 PM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
> I noticed a couple of other inconsistencies/gripes earlier when
> comparing
> behaviour of all Components that I could think of which create 'pop up
> windows' of one kind or another.
>
> CalendarButton
> ColorChooserButton
> ListButton
> MenuButton
> SuggestionPopup
>
> Mainly just focus navigation, but also general keyboard navigation.
>
> I'll add these to a JIRA ticket soon and possibly link them with
> PIVOT-762
> to bundle them together.
>
>
> On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com>
> wrote:
>
> > Chris,
> >        The patch is already attached to the JIRA ticket.  Thanks.
> >
> > Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> > Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> > USA  +1 650-587-5596 | fax: +1 650-587-5550
> > -----Original Message-----
> > From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> > Sent: Tuesday, June 21, 2011 11:52 AM
> > To: dev@pivot.apache.org
> > Subject: Re: Focus transfer when suggestion popup closes
> >
> >  Roger,
> >
> > I think the mailing list accepts zipped patches if you want to try
> again
> > (as
> > the inline one came out garbled in GMail).
> >
> > But now that you have created a JIRA ticket, it might be easier to
> just
> > attacy the patch there for review.
> >
> > I'll take a look tomorrow if not before.
> >
> > Chris
> >
>

RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Sounds good.  Yeah, I was just "focused" on SuggestionPopup 'cause
that's what I've been working on, but there are other issues, as you
noticed.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 12:08 PM
To: dev@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

I noticed a couple of other inconsistencies/gripes earlier when
comparing
behaviour of all Components that I could think of which create 'pop up
windows' of one kind or another.

CalendarButton
ColorChooserButton
ListButton
MenuButton
SuggestionPopup

Mainly just focus navigation, but also general keyboard navigation.

I'll add these to a JIRA ticket soon and possibly link them with
PIVOT-762
to bundle them together.


On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com>
wrote:

> Chris,
>        The patch is already attached to the JIRA ticket.  Thanks.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 11:52 AM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
>  Roger,
>
> I think the mailing list accepts zipped patches if you want to try
again
> (as
> the inline one came out garbled in GMail).
>
> But now that you have created a JIRA ticket, it might be easier to
just
> attacy the patch there for review.
>
> I'll take a look tomorrow if not before.
>
> Chris
>

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
I noticed a couple of other inconsistencies/gripes earlier when comparing
behaviour of all Components that I could think of which create 'pop up
windows' of one kind or another.

CalendarButton
ColorChooserButton
ListButton
MenuButton
SuggestionPopup

Mainly just focus navigation, but also general keyboard navigation.

I'll add these to a JIRA ticket soon and possibly link them with PIVOT-762
to bundle them together.


On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> Chris,
>        The patch is already attached to the JIRA ticket.  Thanks.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 11:52 AM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
>  Roger,
>
> I think the mailing list accepts zipped patches if you want to try again
> (as
> the inline one came out garbled in GMail).
>
> But now that you have created a JIRA ticket, it might be easier to just
> attacy the patch there for review.
>
> I'll take a look tomorrow if not before.
>
> Chris
>

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
No problem.

On 23 June 2011 01:48, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> From my testing this isn't quite the right place, nor is "windowOpened".
>
> So, I'm going to punt on this aspect of it, check in the TAB changes and
> let you look at the ESCAPE/focus issues, okay?!
>
> Thanks.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
>
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Wednesday, June 22, 2011 10:55 AM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
> On 22 June 2011 20:59, Roger L. Whitcomb <Ro...@ingres.com>
> wrote:
>
> >
> >   I *think* that sounds right to restore the original text, but let me
> see
> > if I can
> > get the code to do that.  Probably on the open it could save the
> content
> > and restore
> > it on ESCAPE.  I will try that and repost the diff to the JIRA issue.
> >
> > Roger,
>
> I'm not at my dev box right now, but I think the TextInput's text would
> need
> to be saved when the TextInput loses focus to the ListView.
>
> From memory - the skin will add a ComponentKeyListener to the TextInput
> to
> process an UP or DOWN arrow key press (when the pop up is open and the
> TextInput still has focus) and pass focus to the ListView and select
> either
> the first or last item.  The TextInput's text could probably be captured
> then, as it is the last opportunity that the user had to modify the
> text.
>
> I'm happy to have a look at this if you are busy.  I can bundle it with
> the
> other 'pop up Component issues' I noticed when I add them into JIRA
> tomorrow.
>
> Chris
>

RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
>From my testing this isn't quite the right place, nor is "windowOpened".

So, I'm going to punt on this aspect of it, check in the TAB changes and
let you look at the ESCAPE/focus issues, okay?!

Thanks.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550

-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Wednesday, June 22, 2011 10:55 AM
To: dev@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

On 22 June 2011 20:59, Roger L. Whitcomb <Ro...@ingres.com>
wrote:

>
>   I *think* that sounds right to restore the original text, but let me
see
> if I can
> get the code to do that.  Probably on the open it could save the
content
> and restore
> it on ESCAPE.  I will try that and repost the diff to the JIRA issue.
>
> Roger,

I'm not at my dev box right now, but I think the TextInput's text would
need
to be saved when the TextInput loses focus to the ListView.

>From memory - the skin will add a ComponentKeyListener to the TextInput
to
process an UP or DOWN arrow key press (when the pop up is open and the
TextInput still has focus) and pass focus to the ListView and select
either
the first or last item.  The TextInput's text could probably be captured
then, as it is the last opportunity that the user had to modify the
text.

I'm happy to have a look at this if you are busy.  I can bundle it with
the
other 'pop up Component issues' I noticed when I add them into JIRA
tomorrow.

Chris

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
On 22 June 2011 20:59, Roger L. Whitcomb <Ro...@ingres.com> wrote:

>
>   I *think* that sounds right to restore the original text, but let me see
> if I can
> get the code to do that.  Probably on the open it could save the content
> and restore
> it on ESCAPE.  I will try that and repost the diff to the JIRA issue.
>
> Roger,

I'm not at my dev box right now, but I think the TextInput's text would need
to be saved when the TextInput loses focus to the ListView.

>From memory - the skin will add a ComponentKeyListener to the TextInput to
process an UP or DOWN arrow key press (when the pop up is open and the
TextInput still has focus) and pass focus to the ListView and select either
the first or last item.  The TextInput's text could probably be captured
then, as it is the last opportunity that the user had to modify the text.

I'm happy to have a look at this if you are busy.  I can bundle it with the
other 'pop up Component issues' I noticed when I add them into JIRA
tomorrow.

Chris

RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Hi Chris,
   Let me think about the variable name -- I have no problem with longer names,
if that makes the code more readable.

   I *think* that sounds right to restore the original text, but let me see if I can
get the code to do that.  Probably on the open it could save the content and restore
it on ESCAPE.  I will try that and repost the diff to the JIRA issue.

   Thanks for looking at this.

~Roger Whitcomb


-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
Sent: Wed 6/22/2011 5:38 AM
To: dev@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes
 
Roger,

Looks good to me.

Would something like 'refocusTextInput' more clearly explain the flag's
purpose, or even the verbose 'returnFocusToTextInput'?
Just a personal preference for long variable and method names, so feel free
to ignore :)


While testing I noticed that pressing ESCAPE to close the SuggestionPopup
window does not reset the the TextInput's content if it has been changed
(via the UP/DOWN arrow keys).

My assumption was that the first time a ListView item is selected, the
TextInput's content would be saved and restored if ESCAPE was used to close
the popup window.  Does this sound right?

Chris

On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> Chris,
>        The patch is already attached to the JIRA ticket.  Thanks.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 11:52 AM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
>  Roger,
>
> I think the mailing list accepts zipped patches if you want to try again
> (as
> the inline one came out garbled in GMail).
>
> But now that you have created a JIRA ticket, it might be easier to just
> attacy the patch there for review.
>
> I'll take a look tomorrow if not before.
>
> Chris
>


Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
Roger,

Looks good to me.

Would something like 'refocusTextInput' more clearly explain the flag's
purpose, or even the verbose 'returnFocusToTextInput'?
Just a personal preference for long variable and method names, so feel free
to ignore :)


While testing I noticed that pressing ESCAPE to close the SuggestionPopup
window does not reset the the TextInput's content if it has been changed
(via the UP/DOWN arrow keys).

My assumption was that the first time a ListView item is selected, the
TextInput's content would be saved and restored if ESCAPE was used to close
the popup window.  Does this sound right?

Chris

On 22 June 2011 01:56, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> Chris,
>        The patch is already attached to the JIRA ticket.  Thanks.
>
> Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
> Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
> USA  +1 650-587-5596 | fax: +1 650-587-5550
> -----Original Message-----
> From: Chris Bartlett [mailto:cbartlett.x@gmail.com]
> Sent: Tuesday, June 21, 2011 11:52 AM
> To: dev@pivot.apache.org
> Subject: Re: Focus transfer when suggestion popup closes
>
>  Roger,
>
> I think the mailing list accepts zipped patches if you want to try again
> (as
> the inline one came out garbled in GMail).
>
> But now that you have created a JIRA ticket, it might be easier to just
> attacy the patch there for review.
>
> I'll take a look tomorrow if not before.
>
> Chris
>

RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Chris,
	The patch is already attached to the JIRA ticket.  Thanks.

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com |
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA  +1 650-587-5596 | fax: +1 650-587-5550
-----Original Message-----
From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 11:52 AM
To: dev@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

 Roger,

I think the mailing list accepts zipped patches if you want to try again
(as
the inline one came out garbled in GMail).

But now that you have created a JIRA ticket, it might be easier to just
attacy the patch there for review.

I'll take a look tomorrow if not before.

Chris

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
 Roger,

I think the mailing list accepts zipped patches if you want to try again (as
the inline one came out garbled in GMail).

But now that you have created a JIRA ticket, it might be easier to just
attacy the patch there for review.

I'll take a look tomorrow if not before.

Chris

RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Okay, inline then:

 

Index:
wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.j
ava

===================================================================

---
wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.j
ava       (revision 1138061)

+++
wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.j
ava    (working copy)

@@ -63,6 +63,7 @@

 

     private DropShadowDecorator dropShadowDecorator = null;

     private Transition closeTransition = null;

+    private boolean focusTextInput = true;

 

     private int closeTransitionDuration =
DEFAULT_CLOSE_TRANSITION_DURATION;

     private int closeTransitionRate = DEFAULT_CLOSE_TRANSITION_RATE;

@@ -78,6 +79,7 @@

 

             if (!suggestionPopup.isAncestor(descendant)

                 && descendant != textInput) {

+                focusTextInput = false;

                 suggestionPopup.close(false);

             }

 

@@ -98,6 +100,7 @@

 

             if (!component.isFocused()

                 && !suggestionPopup.containsFocus()) {

+                focusTextInput = false;

                 suggestionPopup.close();

             }

         }

@@ -144,12 +147,43 @@

         }

     };

 

+    private ComponentKeyListener listViewKeyListener = new
ComponentKeyListener.Adapter() {

+        /**

+         * {@link KeyCode#TAB TAB} Close the suggestion popup with a
'result' of

+         * true, and transfer focus forwards from the TextInput.<br>

+         * {@link KeyCode#TAB TAB} + {@link Modifier#SHIFT SHIFT} Close
the

+         * suggestion popup with a 'result' of true, and transfer focus
backwards

+         * from the TextInput.<br>

+         */

+        @Override

+        public boolean keyPressed(Component component, int keyCode,
Keyboard.KeyLocation keyLocation) {

+            SuggestionPopup suggestionPopup =
(SuggestionPopup)getComponent();

+            TextInput textInput = suggestionPopup.getTextInput();

+

+            switch (keyCode) {

+                case Keyboard.KeyCode.TAB: {

+                    focusTextInput = false;

+                    suggestionPopup.close(true);

+

+                    FocusTraversalDirection direction =
(Keyboard.isPressed(Keyboard.Modifier.SHIFT)) ?

+                        FocusTraversalDirection.BACKWARD :
FocusTraversalDirection.FORWARD;

+                    textInput.transferFocus(direction);

+

+                    break;

+                }

+            }

+

+            return false;

+        }

+    };

+

     private static final int DEFAULT_CLOSE_TRANSITION_DURATION = 150;

     private static final int DEFAULT_CLOSE_TRANSITION_RATE = 30;

 

     public TerraSuggestionPopupSkin () {

         listView.getStyles().put("variableItemHeight", true);

 
listView.getListViewSelectionListeners().add(listViewSelectionListener);

+        listView.getComponentKeyListeners().add(listViewKeyListener);

 

         listViewPanorama = new Panorama(listView);

         listViewPanorama.getStyles().put("buttonBackgroundColor",

@@ -261,11 +295,6 @@

     /**

      * {@link KeyCode#ENTER ENTER} Close the suggestion popup with a
'result' of

      * true.<br>

-     * {@link KeyCode#TAB TAB} Close the suggestion popup with a
'result' of

-     * true, and transfer focus forwards from the TextInput.<br>

-     * {@link KeyCode#TAB TAB} + {@link Modifier#SHIFT SHIFT} Close the

-     * suggestion popup with a 'result' of true, and transfer focus
backwards

-     * from the TextInput.<br>

      * {@link KeyCode#ESCAPE ESCAPE} Close the suggestion popup with a
'result'

      * of false.

      */

@@ -280,16 +309,6 @@

                 break;

             }

 

-            case Keyboard.KeyCode.TAB: {

-                suggestionPopup.close(true);

-

-                FocusTraversalDirection direction =
(Keyboard.isPressed(Keyboard.Modifier.SHIFT)) ?

-                    FocusTraversalDirection.BACKWARD :
FocusTraversalDirection.FORWARD;

-                textInput.transferFocus(direction);

-

-                break;

-            }

-

             case Keyboard.KeyCode.ESCAPE: {

                 suggestionPopup.close(false);

                 break;

@@ -327,6 +346,8 @@

 

 
dropShadowDecorator.setShadowOpacity(DropShadowDecorator.DEFAULT_SHADOW_
OPACITY);

 

+        focusTextInput = true;

+

         TextInput textInput = suggestionPopup.getTextInput();

 
textInput.getComponentStateListeners().add(textInputStateListener);

         textInput.getComponentKeyListeners().add(textInputKeyListener);

@@ -428,7 +449,9 @@

 
textInput.getComponentStateListeners().remove(textInputStateListener);

 
textInput.getComponentKeyListeners().remove(textInputKeyListener);

 

-        textInput.requestFocus();

+        if (focusTextInput) {

+            textInput.requestFocus();

+        }

 

         listViewBorder.setEnabled(true);

         closeTransition = null;

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Roger L. Whitcomb [mailto:Roger.Whitcomb@ingres.com] 
Sent: Tuesday, June 21, 2011 11:26 AM
To: dev@pivot.apache.org
Subject: RE: Focus transfer when suggestion popup closes

 

Patch got dropped....

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Roger L. Whitcomb [mailto:Roger.Whitcomb@ingres.com] 
Sent: Tuesday, June 21, 2011 11:23 AM
To: dev@pivot.apache.org
Subject: RE: Focus transfer when suggestion popup closes

 

Transferring to Dev list:

@Chris,

                Just wondering what you thought of the attached patch?
It turns out the TAB character was never making it up to the
SuggestionPopup code - it was being eaten (and ignored) in the ListView
subcomponent of the skin.  And I make the TAB and SHIFT-TAB (as well as
mouse clicks outside the window) not put the focus back on the
TextInput.  From my testing it seems correct now.

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 4:35 AM
To: user@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

 

I just noticed that while this is how *closed* ListButtons behave, but
not *opened* ones.  Perhaps they should?

 

I imagine that MenuButtons should behave the same way as ListButtons,
but it looks like the popup menu does not received focus when it is
opened. This can be seen in the KitchenSink demo by  left clicking on
one of the MenuButtons (in the Menus RollUp) and then trying to use the
arrow keys to navigate within the menu,

http://pivot.apache.org/demos/kitchen-sink.html 

 

Spinners, Sliders, ListViews, TableViews & TreeViews also support their
selections being changed via the keyboard, and then TAB/SHIFT+TAB
transferring focus.

 

ButtonGroups (radio buttons) use TAB/SHIFT+TAB to navigate between
buttons.

(Obviously the Components above do not open child windows)

 

 

On 21 June 2011 13:30, Chris Bartlett <cb...@gmail.com> wrote:

If the SuggestionPopup window is open 

- When the ListView has focus (and therefore a suggestion/list item is
selected), TAB/SHIFT+TAB selects that suggestion, closes the window and
attempts to transfers focus *from* the TextInput according to the
TAB/SHIFT+TAB keycode.  

Note that this last one doesn't currently work as the TAB/SHIFT+TAB
seems to be consumed within the keyPressed handler of the
TerraListViewSkin (via a call to super.keyPressed(...)), but it could be
supported with a new ComponentKeyListener on the ListView.

 


RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Patch got dropped....

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Roger L. Whitcomb [mailto:Roger.Whitcomb@ingres.com] 
Sent: Tuesday, June 21, 2011 11:23 AM
To: dev@pivot.apache.org
Subject: RE: Focus transfer when suggestion popup closes

 

Transferring to Dev list:

@Chris,

                Just wondering what you thought of the attached patch?
It turns out the TAB character was never making it up to the
SuggestionPopup code - it was being eaten (and ignored) in the ListView
subcomponent of the skin.  And I make the TAB and SHIFT-TAB (as well as
mouse clicks outside the window) not put the focus back on the
TextInput.  From my testing it seems correct now.

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 4:35 AM
To: user@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

 

I just noticed that while this is how *closed* ListButtons behave, but
not *opened* ones.  Perhaps they should?

 

I imagine that MenuButtons should behave the same way as ListButtons,
but it looks like the popup menu does not received focus when it is
opened. This can be seen in the KitchenSink demo by  left clicking on
one of the MenuButtons (in the Menus RollUp) and then trying to use the
arrow keys to navigate within the menu,

http://pivot.apache.org/demos/kitchen-sink.html 

 

Spinners, Sliders, ListViews, TableViews & TreeViews also support their
selections being changed via the keyboard, and then TAB/SHIFT+TAB
transferring focus.

 

ButtonGroups (radio buttons) use TAB/SHIFT+TAB to navigate between
buttons.

(Obviously the Components above do not open child windows)

 

 

On 21 June 2011 13:30, Chris Bartlett <cb...@gmail.com> wrote:

If the SuggestionPopup window is open 

- When the ListView has focus (and therefore a suggestion/list item is
selected), TAB/SHIFT+TAB selects that suggestion, closes the window and
attempts to transfers focus *from* the TextInput according to the
TAB/SHIFT+TAB keycode.  

Note that this last one doesn't currently work as the TAB/SHIFT+TAB
seems to be consumed within the keyPressed handler of the
TerraListViewSkin (via a call to super.keyPressed(...)), but it could be
supported with a new ComponentKeyListener on the ListView.

 


RE: Focus transfer when suggestion popup closes

Posted by "Roger L. Whitcomb" <Ro...@ingres.com>.
Transferring to Dev list:

@Chris,

                Just wondering what you thought of the attached patch?
It turns out the TAB character was never making it up to the
SuggestionPopup code - it was being eaten (and ignored) in the ListView
subcomponent of the skin.  And I make the TAB and SHIFT-TAB (as well as
mouse clicks outside the window) not put the focus back on the
TextInput.  From my testing it seems correct now.

 

Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com|
Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 |
USA
<http://www.google.com/maps?f=q&hl=en&geocode=&q=500+Arguello+Street+%7C
+Suite+200+%7C+Redwood+City+%7C+CA+%7C+94063+%7C+USA+&sll=37.0625,-95.67
7068&sspn=50.557552,73.037109&ie=UTF8&t=h&z=16&iwloc=addr>  | +1
650-587-5596 | fax: +1 650-587-5550

From: Chris Bartlett [mailto:cbartlett.x@gmail.com] 
Sent: Tuesday, June 21, 2011 4:35 AM
To: user@pivot.apache.org
Subject: Re: Focus transfer when suggestion popup closes

 

I just noticed that while this is how *closed* ListButtons behave, but
not *opened* ones.  Perhaps they should?

 

I imagine that MenuButtons should behave the same way as ListButtons,
but it looks like the popup menu does not received focus when it is
opened. This can be seen in the KitchenSink demo by  left clicking on
one of the MenuButtons (in the Menus RollUp) and then trying to use the
arrow keys to navigate within the menu,

http://pivot.apache.org/demos/kitchen-sink.html 

 

Spinners, Sliders, ListViews, TableViews & TreeViews also support their
selections being changed via the keyboard, and then TAB/SHIFT+TAB
transferring focus.

 

ButtonGroups (radio buttons) use TAB/SHIFT+TAB to navigate between
buttons.

(Obviously the Components above do not open child windows)

 

 

On 21 June 2011 13:30, Chris Bartlett <cb...@gmail.com> wrote:

If the SuggestionPopup window is open 

- When the ListView has focus (and therefore a suggestion/list item is
selected), TAB/SHIFT+TAB selects that suggestion, closes the window and
attempts to transfers focus *from* the TextInput according to the
TAB/SHIFT+TAB keycode.  

Note that this last one doesn't currently work as the TAB/SHIFT+TAB
seems to be consumed within the keyPressed handler of the
TerraListViewSkin (via a call to super.keyPressed(...)), but it could be
supported with a new ComponentKeyListener on the ListView.

 


Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
I just noticed that while this is how *closed* ListButtons behave, but not
*opened* ones.  Perhaps they should?

I imagine that MenuButtons should behave the same way as ListButtons, but it
looks like the popup menu does not received focus when it is opened. This
can be seen in the KitchenSink demo by  left clicking on one of the
MenuButtons (in the Menus RollUp) and then trying to use the arrow keys to
navigate within the menu,
http://pivot.apache.org/demos/kitchen-sink.html

Spinners, Sliders, ListViews, TableViews & TreeViews also support their
selections being changed via the keyboard, and then TAB/SHIFT+TAB
transferring focus.

ButtonGroups (radio buttons) use TAB/SHIFT+TAB to navigate between buttons.
(Obviously the Components above do not open child windows)


On 21 June 2011 13:30, Chris Bartlett <cb...@gmail.com> wrote:

> If the SuggestionPopup window is open
> - When the ListView has focus (and therefore a suggestion/list item is
> selected), TAB/SHIFT+TAB selects that suggestion, closes the window and
> attempts to transfers focus *from* the TextInput according to the
> TAB/SHIFT+TAB keycode.
> Note that this last one doesn't currently work as the TAB/SHIFT+TAB seems
> to be consumed within the keyPressed handler of the TerraListViewSkin (via a
> call to super.keyPressed(...)), but it could be supported with a new
> ComponentKeyListener on the ListView.
>

Re: Focus transfer when suggestion popup closes

Posted by Chris Bartlett <cb...@gmail.com>.
Roger,

I concur that the current behaviour seems wrong.

The suggestionPopupClosed handler in TerraSuggestionPopupSkin only seems to
be trying to handle the scenarios of the suggestion window being closed with
the ESCAPE or ENTER keys, without considering that a TAB/SHIFT+TAB might be
the reason for the closure.

My expectations of focus navigation would be...
- If the SuggestionPopup window is not open, TAB/SHIFT+TAB behave as per a
regular TextInput, transferring focus from the TextInput
If the SuggestionPopup window is open
- When the TextInput has focus, TAB/SHIFT+TAB behave as for a regular
TextInput, with the SuggestionPopup window being closed as focus is
transferred to the target component.
- When the ListView has focus (and therefore a suggestion/list item is
selected), TAB/SHIFT+TAB selects that suggestion, closes the window and
attempts to transfers focus *from* the TextInput according to the
TAB/SHIFT+TAB keycode.
Note that this last one doesn't currently work as the TAB/SHIFT+TAB seems to
be consumed within the keyPressed handler of the TerraListViewSkin (via a
call to super.keyPressed(...)), but it could be supported with a new
ComponentKeyListener on the ListView.

I would expect the ESCAPE key to close an open SuggestionWindow without
accepting any suggestions and return focus to the TextInput (leaving the
text of the TextInput unchanged).
I would expect the ENTER key to close an open SuggestionWindow and return
focus to the TextInput. It would accept the selected suggestion if the
ListView has focus, or just keep the text of the TextInput if the TextInput
has focus.
Chris

On 21 June 2011 07:24, Roger L. Whitcomb <Ro...@ingres.com> wrote:

> I see that if I TAB off a TextInput field with a SuggestionPopup attached,
> that the operation of the “keyPressed” listener tries to shift focus to the
> next component, but that the “suggestionPopupClosed” listener then tries to
> put the focus back on the TextInput.  Thus, the focus moves for a split
> second and then moves back.
>
>
>
> So, I’m wondering why the latter occurs?  I can see maybe having an
> attribute to determine that or just allowing the move always or
> conditionally allowing the move if the result is “true”, or ….
>
>
>
> What seems right to do?  Right now I would say it is not right what it
> does.
>
>
>
> Thanks.
>
>
>
> *Roger Whitcomb*
>
> Architect, Engineering
>
> *Ingres Corporation*
>
> roger.whitcomb@ingres.com
>
>
>
> *PHONE* +1 650.587.5596
>
> *FAX* +1 650.587.5550
>
>
>
> *www.ingres.com* <http://www.ingres.com/>
>
>
>
> This transmission is confidential and intended solely for the use of the
> recipient named above. It may contain confidential, proprietary, or legally
> privileged information. If you are not the intended recipient, you are
> hereby notified that any unauthorized review, use, disclosure or
> distribution is strictly prohibited. If you have received this transmission
> in error, please contact the sender by reply e-mail and delete the original
> transmission and all copies from your system.
>
>
>