You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/05/31 17:06:02 UTC

[jira] [Comment Edited] (WICKET-5603) OnChangeAjaxBehavior attached to DropDownChoice produces two Ajax requests in Chrome v35

    [ https://issues.apache.org/jira/browse/WICKET-5603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14014675#comment-14014675 ] 

Martin Grigorov edited comment on WICKET-5603 at 5/31/14 3:05 PM:
------------------------------------------------------------------

To listen for changes on HTMLSelect element one should use "change" event (with AjaxFormComponentUpdatingBehavior).
It seems with ver. 35 Chrome started firing "input" event is for HTMLSelect too. I have no idea why ...
"input" event is for <input type="text"> and is fired on every added/removed character.

Another solution is to stop the event propagation (org.apache.wicket.ajax.attributes.AjaxRequestAttributes.EventPropagation#STOP_IMMEDIATE) but this may have side effects for the different applications.

So I think OnChangeAjaxBehavior should be disallowed for anything but TextField and TextArea.
See:
- http://help.dottoro.com/ljhxklln.php
- http://msdn.microsoft.com/en-us/library/ie/gg592978(v=vs.85).aspx
- https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.oninput



was (Author: mgrigorov):
To listen for changes on HTMLSelect element one should use "change" event (with AjaxFormComponentUpdatingBehavior).
It seems with ver. 35 Chrome started firing "input" event is for HTMLSelect too. I have no idea why ...
"input" event is for <input type="text"> and is fired on every added/removed character.

Another solution is to stop the event propagation (org.apache.wicket.ajax.attributes.AjaxRequestAttributes.EventPropagation#STOP_IMMEDIATE) but this may have side effects for the different applications.

So I think OnChangeAjaxBehavior should be disallowed for anything but TextField and TextArea.
See:
- http://help.dottoro.com/ljhxklln.php
- http://msdn.microsoft.com/en-us/library/ie/gg592978(v=vs.85).aspx
- https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.oninput


Acc

> OnChangeAjaxBehavior attached to DropDownChoice produces two Ajax requests in Chrome v35
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-5603
>                 URL: https://issues.apache.org/jira/browse/WICKET-5603
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.9.1
>         Environment: Chrome 35.0.1916.114
>            Reporter: Andrey Krasnopolsky
>            Assignee: Andrea Del Bene
>         Attachments: test.zip
>
>
> I have a DropDownChoice with attached OnChangeAjaxBehavior, like this:
> {code:borderStyle=solid}
> new DropDownChoice<>("dd", new Model<>(), Arrays.asList( "First", "Second"))
>     .add( new OnChangeAjaxBehavior() {
>         @Override
>         protected void onUpdate(AjaxRequestTarget target) {
>             System.out.println( "update" );
>         }
> });
> {code}
> When selecting any of drop down options, two Ajax requests being generated.
> It behaves OK in IE, FF and Chrome v34, only Chrome v35 is affected 
>  



--
This message was sent by Atlassian JIRA
(v6.2#6252)