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

Generating invalid JavaScript for ajax update

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 6.8.0
    • wicket
    • None

    Description

      Suppose I have BlinkBehaviour

      public static class BlinkBehaviour extends Behavior {
      @Override
      public void renderHead(Component component, IHeaderResponse response) {
      AjaxRequestTarget target = component.getRequestCycle().find(AjaxRequestTarget.class);
      if (target != null)

      { target.prependJavaScript("notify|jQuery('#" + component.getMarkupId() + "').fadeOut(400, notify);"); target.appendJavaScript("jQuery('#"+component.getMarkupId()+"').fadeIn(400);"); }


      }
      }

      If I add it twice to a control and update the control via ajax 6.7.0-SNAPSHOT will yield error:

      ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: SyntaxError: Unexpected token ), text: f = function(notify)

      {jQuery('#version2').fadeOut(400, notify);}

      )();(function()

      {notify|jQuery('#version2').fadeOut(400, notify);}

      ;

      Attachments

        1. myproject.zip
          34 kB
          Alexey Mukas

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            amukas Alexey Mukas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: