Wicket
  1. Wicket
  2. WICKET-5142

Generating invalid JavaScript for ajax update

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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);}

      ;

      1. myproject.zip
        34 kB
        Alexey Mukas

        Activity

        Alexey Mukas created issue -
        Alexey Mukas made changes -
        Field Original Value New Value
        Attachment myproject.zip [ 12578400 ]
        Martin Grigorov made changes -
        Assignee Martin Grigorov [ mgrigorov ]
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 6.8.0 [ 12324068 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development