Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1795

Suggest component throws js error: 'afterUpdateElement is not a function'

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 4.1.2
    • 4.1.5
    • Framework
    • None

    Description

      It is not possible to define a client side javascript function to be called after the element has been updated.
      Something like: options=literal:

      {afterUpdateElement: myAfterUpdateElement}

      doesn't work because the method JSONObject#valueToString is always quoting all the elements of the json object. The output of the component is:

      var suggest = new Ajax.Autocompleter(......, ......,

      {.....,"afterUpdateElement":"myAfterUpdateElement",......}

      );

      But Ajax.Autocompleter expects a reference to a js function. Thats is the reason for the js error:

      this.options.afterUpdateElement is not a function
      [Break on this error] this.options.afterUpdateElement(this.element, selectedElement);

      Attachments

        1. TAPESTRY-1795.patch
          1 kB
          Igor Drobiazko

        Activity

          People

            andyhot Andreas Andreou
            igor.drobiazko Igor Drobiazko
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment