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

Palette Ajax update does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 6.4.0
    • None
    • None

    Description

      Javadoc of org.apache.wicket.extensions.markup.html.form.palette.Palette describes a method of receiving ajax updates when the selection has changed:

      Palette palette=new Palette(...) {
      protected Recorder newRecorderComponent()
      {
      Recorder recorder=super.newRecorderComponent();
      recorder.add(new AjaxFormComponentUpdatingBehavior("onchange")

      {...}

      );
      return recorder;
      }
      }

      Prior to wicket 6 this worked, but the jQuery integration broke this functionality. The problem lies in palette.js line 127:

      if (recorder.onchange!=null)

      { recorder.onchange(); }

      Here the change event should be fired when the content of the hidden input field that is used to record the selection changes. However since the ajax update on the onchange event is registered by AjaxFormComponentUpdatingBehavior with jQuery, recorder.onchange will always be null.

      The solution might be something like this:

      $(recorder).change()

      Attachments

        Activity

          People

            svenmeier Sven Meier
            aka Andreas Kappler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: