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

Martin Tzvetanov Grigorov commented on WICKET-6853:
---------------------------------------------------

Some history:

OnChangeAjaxBehavior initially used only JavaScript *change* event. As 
[https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event] 
explains this event fires: "When the element loses focus after its value was 
changed ..." (for input and textarea).

Later when *input* JavaScript event ** became supported by all major browsers 
it has been added to OnChangeAjaxBehavior. So now it fires Ajax calls for any 
edit *and* for focus out. ** 

 

As Sven suggested if this is not what you want you can always use directly the 
parent class (AjaxFormComponentUpdatingBehavior) or override its 
updateAjaxAttributes(AjaxRequestAttributes).

> OnChangeAjaxBehaviour gets called if there was no change
> --------------------------------------------------------
>
>                 Key: WICKET-6853
>                 URL: https://issues.apache.org/jira/browse/WICKET-6853
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 8.10.0
>            Reporter: Stefan Franke
>            Assignee: Sven Meier
>            Priority: Minor
>
> Consider this code where a TextField gets a OnChangeAjaxBehaviour 
> {code:java}
> // 
> TextField<String> tf = new TextField<>("id", model);
> tf.add(new OnChangeAjaxBehaviour() {
>   public void onUpdate(AjaxRequestTarget target) {
>     LOG.debug("update");
>   }
> }
> form.add(tf){code}
> The onUpdate() method is also called on focus out. But focus out does no 
> updates.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to