Uploaded image for project: '[Read Only] - Hippo Wicket ExtJS'
  1. [Read Only] - Hippo Wicket ExtJS
  2. WICKETEXTJS-52

Non-string event listener parameters are not encoded correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • None

    Description

      Event listener parameters of type 'array' or 'object' not encoded correctly and therefore interpreted as strings on the server side.

      For example, say we have the following ExtJS JavaScript:

      this.fireEvent('foo', [ 'one', 'two' ]);

      The Wicket Ajax code eventually converts the array parameter to URL encoded string using jQuery.param in (wicket-ajax-jquery.js, line 555-556):

      // convert to URL encoded string
      data = jQuery.param(data);

      For the example this boils down to:

      jQuery.param([

      {name: 'foo', value: ['one','two']}

      ]);

      This results in the following encoded query parameter in the URL:

      "foo=one%2Ctwo"

      Since the value does not start with a '[', the server-side parsing of the value does not convert it to a JSONArray, but to the following string:

      "one,two"

      As a result, the server-side event listener code will get a JSONArray object with only this string in it. As long as the passed array contains only one string everything will still work correctly, but with multiple strings errors will occur.

      Attachments

        Issue Links

          Activity

            People

              fvlankvelt Frank van Lankvelt (Inactive)
              mdenburger Mathijs den Burger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: