Wicket
  1. Wicket
  2. WICKET-5234

OnEventHeaderItem can't be applied via AJAX

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.9.0, 1.5.11, 7.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      OnEventHeaderItem doesn't have effect if it is applied to a component refreshed via AJAX. In short, OnEventHeaderItem is applied before the component is refreshed via AJAX, hence the releated event handler is removed from the target component.
      We could modify JavaScript function Wicket.Ajax.Call.loadedCallback in order to apply header contributors after the component has been refreshed (see patch).

      1. EventScript.patch
        2 kB
        Andrea Del Bene
      2. OnEventAjax.zip
        32 kB
        Andrea Del Bene
      3. WICKET-5234.patch
        1 kB
        Andrea Del Bene

        Activity

        Hide
        Andrea Del Bene added a comment -

        I've attached a quickstart project as well to show you the problem.

        Show
        Andrea Del Bene added a comment - I've attached a quickstart project as well to show you the problem.
        Hide
        Martin Grigorov added a comment -

        The suggested patch is not good because the prepended/appended scripts by AjaxRequestTarget may need JS library to be able to do their job.

        Show
        Martin Grigorov added a comment - The suggested patch is not good because the prepended/appended scripts by AjaxRequestTarget may need JS library to be able to do their job.
        Hide
        Martin Grigorov added a comment -

        AjaxHeaderResponse now handles OnEventHeaderItem specially as it already does with OnLoad and OnDomReady header items

        Show
        Martin Grigorov added a comment - AjaxHeaderResponse now handles OnEventHeaderItem specially as it already does with OnLoad and OnDomReady header items
        Hide
        Andrea Del Bene added a comment -

        Method getJavaScript of OnEventHeaderItem returns the script without its event handler. I added a patch that adds method getFullJavaScript to OnEventHeaderItem to solve the problem.

        Show
        Andrea Del Bene added a comment - Method getJavaScript of OnEventHeaderItem returns the script without its event handler. I added a patch that adds method getFullJavaScript to OnEventHeaderItem to solve the problem.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Andrea Del Bene
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development