You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Gerolf Seitz (JIRA)" <ji...@apache.org> on 2008/03/27 16:35:25 UTC

[jira] Created: (WICKET-1454) enter in AutoCompleteTextField submits form 2-4 times

enter in AutoCompleteTextField submits form 2-4 times
-----------------------------------------------------

                 Key: WICKET-1454
                 URL: https://issues.apache.org/jira/browse/WICKET-1454
             Project: Wicket
          Issue Type: Bug
          Components: wicket-extensions
            Reporter: Gerolf Seitz
             Fix For: 1.3.3


in certain conditions, hitting enter in an autocompletetextbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)

we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep? onkeypress (since it's the last of the 3 events)?

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


[jira] Commented: (WICKET-1454) Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times

Posted by "Gerolf Seitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582784#action_12582784 ] 

Gerolf Seitz commented on WICKET-1454:
--------------------------------------

the problem is that onkeydown executes the original onchange (attached AFSB) event handler of the textbox when KEY_ENTER is pressed and doesn't kill the event.
next, onkeypress doesn't kill the event because no item is selected, which leads to the form being submitted via a non-ajax roundtrip.

now what we could/should do is NOT call onchange in onkeydown in the KEY_ENTER block, as browsers only fire the change event when the textbox loses focus.

wdyt?

> Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times
> ------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1454
>                 URL: https://issues.apache.org/jira/browse/WICKET-1454
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>            Reporter: Gerolf Seitz
>            Assignee: Gerolf Seitz
>             Fix For: 1.3.3
>
>
> when the autocomplete menu is hidden, hitting enter in an autocomplete-textbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)
> we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep?

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


[jira] Commented: (WICKET-1454) enter in AutoCompleteTextField submits form 2-4 times

Posted by "Janne Hietamäki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582700#action_12582700 ] 

Janne Hietamäki commented on WICKET-1454:
-----------------------------------------

I think onkeypress is the safest bet.

http://www.quirksmode.org/js/keys.html

> enter in AutoCompleteTextField submits form 2-4 times
> -----------------------------------------------------
>
>                 Key: WICKET-1454
>                 URL: https://issues.apache.org/jira/browse/WICKET-1454
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>            Reporter: Gerolf Seitz
>             Fix For: 1.3.3
>
>
> in certain conditions, hitting enter in an autocompletetextbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)
> we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep? onkeypress (since it's the last of the 3 events)?

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


[jira] Resolved: (WICKET-1454) Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times

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

Gerolf Seitz resolved WICKET-1454.
----------------------------------

    Resolution: Fixed

i think the following behavior is what a user would expect: (focus is always on textbox)

menu visible, select item with keyboard, ENTER -> invoke onchange of textbox
menu visible, ESC, ENTER -> submit form
menu visible, no item selected, ENTER -> submit form
menu visible, click on item with mouse -> invoke onchange of textbox
menu hidden, ENTER -> submit form
type some letters, click somewhere on the page -> invoke onchange of textbox



> Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times
> ------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1454
>                 URL: https://issues.apache.org/jira/browse/WICKET-1454
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>            Reporter: Gerolf Seitz
>            Assignee: Gerolf Seitz
>             Fix For: 1.3.3
>
>
> when the autocomplete menu is hidden, hitting enter in an autocomplete-textbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)
> we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep?

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


[jira] Updated: (WICKET-1454) enter in AutoCompleteTextField submits form 2-4 times

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

Gerolf Seitz updated WICKET-1454:
---------------------------------

       Assignee: Gerolf Seitz
    Description: 
when the autocomplete menu is hidden, hitting enter in an autocomplete-textbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)

we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep?

  was:
in certain conditions, hitting enter in an autocompletetextbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)

we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep? onkeypress (since it's the last of the 3 events)?


> enter in AutoCompleteTextField submits form 2-4 times
> -----------------------------------------------------
>
>                 Key: WICKET-1454
>                 URL: https://issues.apache.org/jira/browse/WICKET-1454
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>            Reporter: Gerolf Seitz
>            Assignee: Gerolf Seitz
>             Fix For: 1.3.3
>
>
> when the autocomplete menu is hidden, hitting enter in an autocomplete-textbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)
> we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep?

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


[jira] Updated: (WICKET-1454) Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times

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

Gerolf Seitz updated WICKET-1454:
---------------------------------

    Summary: Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times  (was: enter in AutoCompleteTextField submits form 2-4 times)

> Enter in AutoCompleteTextField with AjaxFormSubmitBehavior on change-event submits form multiple times
> ------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1454
>                 URL: https://issues.apache.org/jira/browse/WICKET-1454
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>            Reporter: Gerolf Seitz
>            Assignee: Gerolf Seitz
>             Fix For: 1.3.3
>
>
> when the autocomplete menu is hidden, hitting enter in an autocomplete-textbox submits the form several times (due to event handling in onkeydown, onkeyup, onkeypress)
> we should kill the event in 2 of the 3 eventhandlers. which one would be the best to keep?

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