DatePicker calles onchange
--------------------------

                 Key: WICKET-1869
                 URL: https://issues.apache.org/jira/browse/WICKET-1869
             Project: Wicket
          Issue Type: Bug
          Components: wicket-datetime
    Affects Versions: 1.4-M3
            Reporter: Ɓukasz Wysocki


Prerequisites:
TextField with a date alredy set (say an initial value) and an DatePicker added.

Action:
Press the Calendar icon.

Effect:
The TextFields onchange event is fired.  It should not be fired becouse the 
value was alredy set and not given by the calendar.

Where to start:
file: wicket-date.js 
function Wicket.DateTime.showCalendar (line 146) does an widget.select(date) -> 
in there we have this.selectEvent.fire(validDates); (line 3470) -> in there ret 
= s.fn.call(scope, this.type, args, s.obj); (line 254) -> AND :) in there we 
ALWAYS execute the onchange if (field.onchange != null && 
typeof(field.onchange) != 'undefined') field.onchange(); (line 186). 

Why is it a important for me -- i have an AJAX callback on the TextField which 
updates the text field after onchange (makes it red if  one of validation rules 
failes). Effect for my is that when i click the calendar it shows and then is 
hidden again becouse the field is aded to ajax target and rendered again with 
the calendar hidden.


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

Reply via email to