Wicket
  1. Wicket
  2. WICKET-5181

Problem with OnEventHeaderItem and Wicket.Event.add

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.7.0
    • Fix Version/s: 6.8.0, 7.0.0
    • Component/s: None
    • Labels:
      None

      Description

      OnEventHeaderItem uses function Wicket.Event.add from wicket-event-jquery.js to bind a script to specific event fired for a given DOM element.
      The function allows to specify the DOM element using its id. In this case the element is retrieved with standard function document.getElementById.
      However, this scenario fails when we apply it through OnEventHeaderItem because Wicket.Event.add is invoked before the DOM is ready (see attached quickstart). Therefore, we should modify the function to check for DOM-ready state (see attached patch).

      1. WICKET-5181.patch
        2 kB
        Andrea Del Bene
      2. Quickstart.zip
        31 kB
        Andrea Del Bene

        Activity

        Hide
        Martin Grigorov added a comment -

        I simplified the patch by removing the check for #isReady(). jQuery(fn) will execute immediately if the DOM is ready.

        Show
        Martin Grigorov added a comment - I simplified the patch by removing the check for #isReady(). jQuery(fn) will execute immediately if the DOM is ready.

          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