You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Todd Volkert (JIRA)" <ji...@apache.org> on 2009/07/23 13:25:14 UTC

[jira] Created: (PIVOT-187) ContainerSkin.IndexFocusTraversalPolicy will return hidden and disabled components

ContainerSkin.IndexFocusTraversalPolicy will return hidden and disabled components
----------------------------------------------------------------------------------

                 Key: PIVOT-187
                 URL: https://issues.apache.org/jira/browse/PIVOT-187
             Project: Pivot
          Issue Type: Bug
          Components: wtk
    Affects Versions: 1.2, 1.1
            Reporter: Todd Volkert
            Assignee: Todd Volkert
             Fix For: 1.3


Use case: create a CardPane with two cards and selectedIndex==2, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.

The reason is that the index focus traversal policy used by the card pane (and most containers for that matter) will return you the first card because it's at index 0, but it fails to take into account the fact that the first card is invisible and thus not focusable.  CardPane then calls requestFocus() on that invisible card, which ends up doing nothing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PIVOT-187) Container.requestFocus() lacks logic found in Component.transferFocus()

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Volkert resolved PIVOT-187.
--------------------------------

    Resolution: Fixed

This has been fixed.  There was another latent bug in Container.requestFocus(), in that it wasn't propagating the temporary flag to the recursive requestFocus() call.

> Container.requestFocus() lacks logic found in Component.transferFocus()
> -----------------------------------------------------------------------
>
>                 Key: PIVOT-187
>                 URL: https://issues.apache.org/jira/browse/PIVOT-187
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.1, 1.2
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>             Fix For: 1.3
>
>
> Use case: create a CardPane with two cards and selectedIndex==1, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.
> The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.  In the use case above, the index focus traversal policy returns the card at index 0, which is not focusable because it's not visible, and requestFocus() leaves it at that (having given nothing the focus).
> This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-187) Container.requestFocus() lacks logic found in Component.transferFocus()

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Volkert updated PIVOT-187:
-------------------------------

    Description: 
Use case: create a CardPane with two cards and selectedIndex==1, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.

The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.  In the use case above, the index focus traversal policy returns the card at index 0, which is not focusable because it's not visible, and requestFocus() leaves it at that (having given nothing the focus).

This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.

  was:
Use case: create a CardPane with two cards and selectedIndex==2, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.

The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.

This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.


> Container.requestFocus() lacks logic found in Component.transferFocus()
> -----------------------------------------------------------------------
>
>                 Key: PIVOT-187
>                 URL: https://issues.apache.org/jira/browse/PIVOT-187
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.1, 1.2
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>             Fix For: 1.3
>
>
> Use case: create a CardPane with two cards and selectedIndex==1, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.
> The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.  In the use case above, the index focus traversal policy returns the card at index 0, which is not focusable because it's not visible, and requestFocus() leaves it at that (having given nothing the focus).
> This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIVOT-187) Container.requestFocus() lacks logic found in Component.transferFocus()

Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Volkert updated PIVOT-187:
-------------------------------

    Description: 
Use case: create a CardPane with two cards and selectedIndex==2, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.

The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.

This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.

  was:
Use case: create a CardPane with two cards and selectedIndex==2, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.

The reason is that the index focus traversal policy used by the card pane (and most containers for that matter) will return you the first card because it's at index 0, but it fails to take into account the fact that the first card is invisible and thus not focusable.  CardPane then calls requestFocus() on that invisible card, which ends up doing nothing.

        Summary: Container.requestFocus() lacks logic found in Component.transferFocus()  (was: ContainerSkin.IndexFocusTraversalPolicy will return hidden and disabled components)

> Container.requestFocus() lacks logic found in Component.transferFocus()
> -----------------------------------------------------------------------
>
>                 Key: PIVOT-187
>                 URL: https://issues.apache.org/jira/browse/PIVOT-187
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 1.1, 1.2
>            Reporter: Todd Volkert
>            Assignee: Todd Volkert
>             Fix For: 1.3
>
>
> Use case: create a CardPane with two cards and selectedIndex==2, where the second card is a TextInput.  Now call cardPane.requestFocus().  You'd expect the TextInput to gain the focus, but it doesn't.
> The reason is that Container.requestFocus() asks its focus traversal policy for the next component, but it performs no checks on that next component to see if it's focusable or if it's a container that should be traversed.  Such checks exist in Component.transferFocus(), which behaves as you'd expect.
> This leads to a confusing disparity between transferFocus() and requestFocus() -- one works as you'd expect,and the other doesn't.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.