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

AjaxEventBehavior should not lower-case the event name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.0.0-M5, 7.0.0-M6
    • 7.0.0, 6.21.0
    • None
    • None

    Description

      I'm using the Bootstrap DatePicker js library (also included in wicket-boostrap)
      doc: http://bootstrap-datepicker.readthedocs.org/

      I extended AjaxEventBehavior to implement Bootstrap-DataPicker's 'changeDate' event.

      my first attempted failed. My AjaxEventBehavior was never triggered. after further investigation I discovered that the event name was all in lowercase! (which prevented latest chrome to trigger it)

      Wicket.Ajax.ajax({"u":"./?2-2.IBehaviorListener.0-calendarLink","c":"calendarLink6","dep":[function(attrs){return [

      {'name':'newDate', 'value': attrs.event.format()}

      ]}],"e":"changedate"});;

      the getEvent method in AjaxEventBehavior is lowercase the event name!

      public String getEvent()
      {
      String events = event.toLowerCase();

      for my case, I just overridden the getEvent to make it work.

      I couldn't find a clear description/specification related to case-sensitive or case-insensitive!
      one possible hint https://en.wikipedia.org/wiki/DOM_events under Event object:
      DOMString (type): The name of the event (case-insensitive in DOM level 2 but case-sensitive in DOM level 3).

      should
      String events = event.toLowerCase()
      be removed?

      and Martin Grigorov added the following comment
      http://www.w3.org/TR/DOM-Level-3-Events/ confirms what you say.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              gabriel.bucher Gabriel Bucher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: