Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2850

Wicket DateTimeField / DatePicker creates a memory leak on the browser when rerenderd using ajax requests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4.11, 1.5-M2.1
    • wicket-datetime
    • Firefox 3.6, Internet Explorer 8, Opera 9.10

    Description

      When a wicket DateTimeField is repeatedly added to a page using AjaxRequestTarget#addComponent(..) it creates a memory leak on the browser. This will eventually cause memory starvation
      on the client machine.

      The error can be reproduced by using a DateTimeField component that updates itself using the AjaxSelfUpdatingTimeBehavior.

      DateTimeField field= new DateTimeField("field", new Model<Date>(new Date()));
      field.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(0.5)));
      add(field);

      Running this for just an hour or so clearly shows that the browsers do not free up resources. The problem seems to be related to how wicket-date.js reinitializes a new Yahoo Yui Calendar widget using the same element id on each rerendering.

      Attachments

        1. WICKET-2850.patch
          1 kB
          Martin Grigorov
        2. Dummy.java
          0.6 kB
          Andre L
        3. Dummy.html
          0.2 kB
          Andre L

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              jomarl Andre L
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: