You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juha Paananen (JIRA)" <ji...@apache.org> on 2010/03/05 10:50:27 UTC

[jira] Commented: (WICKET-2424) OnChangeAjaxBehavior + DatePicker do not work together

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

Juha Paananen commented on WICKET-2424:
---------------------------------------

I ran to into the same problem with Wicket 1.4.6. I have a patch for this. The idea of the patch is to save the original "onchange" function of the textfield into "onchangeoriginal" function and then use this function in wicket-date.js:

wicket-date.js
+	if (field.onchangeoriginal != null && typeof(field.onchangeoriginal) != 'undefined') field.onchangeoriginal();
wicket-ajax.js
+	obj.onchangeoriginal = obj.onchange;

Full patch attached.

> OnChangeAjaxBehavior + DatePicker do not work together
> ------------------------------------------------------
>
>                 Key: WICKET-2424
>                 URL: https://issues.apache.org/jira/browse/WICKET-2424
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.4.0
>         Environment: Firefox, IE
>            Reporter: Alexey Varlamov
>            Priority: Minor
>
> DatePicker fails to notify component update when OnChangeAjaxBehavior is used on the target input.
> It works well with AjaxFormComponentUpdatingBehavior.
> The root cause seems to be in the Wicket.ChangeHandler added by the OnChangeAjaxBehavior, which hides user handler while the DatePicker calls onchange handler directly (wicket-date.js:186):
> if (field.onchange != null && typeof(field.onchange) != 'undefined') field.onchange(); 
> Possible fix could be dispatching onchange Event instead of direct handler invocation. 
> Yet I don't know what is purpose of Wicket.ChangeHandler here...

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