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

AbstractAjaxBehavior should clean stored reference to a component on unbind

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 6.5.0, 1.5.10
    • None
    • None

    Description

      AbstractAjaxBehavior isn't reusable right now. It saves a reference to a component on bind and doesn't properly clean it on unbind. It breaks the add/remove contract for behaviors. If a behavior is particularly expensive to create we should be able to remove it and reuse later on the same or other components.
      Here is a simple fix:

      @Override
      public final void unbind(final Component hostComponent)

      { component = null; // call the callback onUnbind(); }

      protected void onUnbind()
      {
      }

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              vtsaplin Vitaly Tsaplin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: