DatePicker javaScript should be optimized. Currently DatePicker generates 3000 
bytes of javascript for each date field.
-----------------------------------------------------------------------------------------------------------------------

                 Key: WICKET-1790
                 URL: https://issues.apache.org/jira/browse/WICKET-1790
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
    Affects Versions: 1.4-M1
            Reporter: Martin Makundi


Currently DatePicker generates 3000 bytes of javascript per each date field 
(more specifically per each date field having DatePicker).

If you have a table with 2 date columns and 10 rows this means 60000 bytes 
excess HTTP traffic. And it shows. It slows down page rendering significantly.

DatePicker javaScript should be optimized. I myself am not a javascript wizard, 
I do not know which hooks could serve this change. But I know where the problem 
is: each datePicker component is given its own initializer methods instead of 
using parametrized method calls:

// block 1
initproject__employee__startdate123 = function() {
  Wicket.DateTime.init( {
    widgetId: "project__employee__startdate123",            <---------- this 
should be suitably parametrized
    componentId: "project__employee__startdate123",       <---------- this 
should be suitably parametrized
  ....
}

// block 2
if (wicketCalendarInitFinished) {
  initproject__employee__startdate123();  <---------- this should be suitably 
parametrized
} else {
  wicketCalendarInits.push(initproject__employee__startdate123); <---------- 
this should be suitably parametrized
}




-- 
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