You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carlos Pita (JIRA)" <ji...@apache.org> on 2007/09/11 18:59:32 UTC

[jira] Created: (WICKET-957) Change default focus component for focus related events to null

Change default focus component for focus related events to null
---------------------------------------------------------------

                 Key: WICKET-957
                 URL: https://issues.apache.org/jira/browse/WICKET-957
             Project: Wicket
          Issue Type: Improvement
    Affects Versions: 1.3.0-beta3
            Reporter: Carlos Pita
             Fix For: 1.3.0-beta4


Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.

For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.

This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.



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


[jira] Commented: (WICKET-957) Change default focus component for focus related events to null

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526580 ] 

Johan Compagner commented on WICKET-957:
----------------------------------------

you are saying that when you have an onblur ajax event that then the focus is set back to that field when the ajax call returns?
that shouldn't happen, because something else should have focus then, but i see the problem that when that something 
else is not another field then that field has still the value set.

So the fix should be that we also listen to onblur and set the field on in javascript to null then.  But then we have to be sure for 2 things

is onblur always before onfocus of the next one?

is onblur called when we replace the component, if that is the case then those onblurs should be ignored.

> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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


[jira] Updated: (WICKET-957) Change default focus component for focus related events to null

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

Carlos Pita updated WICKET-957:
-------------------------------

    Component/s: wicket
       Priority: Minor  (was: Major)

> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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


[jira] Commented: (WICKET-957) Change default focus component for focus related events to null

Posted by "Carlos Pita (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539795 ] 

Carlos Pita commented on WICKET-957:
------------------------------------


Yes, the decisive factor here is what this other field happens to be.
If it is a widget of the browser own ui it won't keep focus after
validation takes place. There are some third party components (of
which I'm aware of tinymce) that present a similar behavior too. All
in all, the resulting user experience is quite odd.


> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta5
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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


[jira] Commented: (WICKET-957) Change default focus component for focus related events to null

Posted by "Carlos Pita (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526588 ] 

Carlos Pita commented on WICKET-957:
------------------------------------

Yes, the decisive factor here is what this other field happens to be.
If it is a widget of the browser own ui it won't keep focus after
validation takes place. There are some third party components (of
which I'm aware of tinymce) that present a similar behavior too. All
in all, the resulting user experience is quite odd.


> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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


[jira] Resolved: (WICKET-957) Change default focus component for focus related events to null

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

Matej Knopp resolved WICKET-957.
--------------------------------

    Resolution: Fixed

When event is blur we don't focus the source component by default

> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta5
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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


[jira] Updated: (WICKET-957) Change default focus component for focus related events to null

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-957:
--------------------------------------

    Fix Version/s:     (was: 1.3.0-beta4)
                   1.3.0-beta5

> Change default focus component for focus related events to null
> ---------------------------------------------------------------
>
>                 Key: WICKET-957
>                 URL: https://issues.apache.org/jira/browse/WICKET-957
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Carlos Pita
>            Priority: Minor
>             Fix For: 1.3.0-beta5
>
>
> Currently the default behavior for ajax requests is to restore focus on last focused element. This produces some bizarre situations when onfocus or onblur are used for ajax validation.
> For example, if the form component to be validated gets its focus transferred to some browser ui widget (say, the location bar), triggering an onblur validation this way, it immediately recaptures focus after validation has been completed (making it impossible to type text at the location bar unless your fingers happen to be faster than the ajax rtt, to follow the example). A similar problem occurs with tinymce editor, at least.
> This behavior can be circumvented explicitly setting target.focusComponent(null) for validation purposes, but why is it not this way in the first place, at least for the focus related events? With a better behaved default quite a number of ugly situations for such common use case as ajax validation is could be avoided.

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