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

Generating invalid JavaScript for ajax update

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.8.0
    • Component/s: wicket
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: