Wicket
  1. Wicket
  2. WICKET-1402

External JAvascript references not included

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Component/s: wicket
    • Labels:
      None

      Description

      When using IHeaderResponse to include an external Javascript file, it is not included because of this bug:

      Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java
      ===================================================================
      — /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (revision 614519)
      +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (working copy)
      @@ -177,7 +177,7 @@
      {
      List token1 = Arrays.asList(new Object[]

      { "javascript", url }

      );
      List token2 = Arrays.asList(new Object[]

      { "javascript", id }

      );

      • if (wasRendered(token1) == false && wasRendered(token2))
        + if (wasRendered(token1) == false && wasRendered(token2) == false)
        {
        JavascriptUtils.writeJavascriptUrl(getResponse(), url, id);
        markRendered(token1);
        @@ -258,8 +258,7 @@
        {
        if (!closed)
        {
      • List token = Arrays
      • .asList(new Object[] { "javascript-event", target, event, javascript });
        + List token = Arrays.asList(new Object[] { "javascript-event", target, event, javascript }

        );
        if (wasRendered(token) == false)
        {
        renderJavascriptReference(WicketEventReference.INSTANCE);
        @@ -264,7 +263,7 @@
        {
        renderJavascriptReference(WicketEventReference.INSTANCE);
        JavascriptUtils.writeJavascript(getResponse(), "Wicket.Event.add(" + target +

      • ", \"" + event + "\", function() { " + javascript + ";});");
        + ", \"" + event + "\", function() { " + javascript + ";}

        );");
        markRendered(token);
        }
        }
        @@ -275,7 +274,7 @@
        */
        public void close()

        { - this.closed = true; + closed = true; }

      /**

        Activity

        Hide
        John Patterson added a comment -

        Sorry that patch is rubbish - I don;t know why that other stuff was included. Here we go...

        Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java
        ===================================================================
        — /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (revision 614519)
        +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (working copy)
        @@ -177,7 +177,7 @@
        {
        List token1 = Arrays.asList(new Object[]

        { "javascript", url }

        );
        List token2 = Arrays.asList(new Object[]

        { "javascript", id }

        );

        • if (wasRendered(token1) == false && wasRendered(token2))
          + if (wasRendered(token1) == false && wasRendered(token2) == false)
          {
          JavascriptUtils.writeJavascriptUrl(getResponse(), url, id);
          markRendered(token1);
        Show
        John Patterson added a comment - Sorry that patch is rubbish - I don;t know why that other stuff was included. Here we go... Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java =================================================================== — /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (revision 614519) +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java (working copy) @@ -177,7 +177,7 @@ { List token1 = Arrays.asList(new Object[] { "javascript", url } ); List token2 = Arrays.asList(new Object[] { "javascript", id } ); if (wasRendered(token1) == false && wasRendered(token2)) + if (wasRendered(token1) == false && wasRendered(token2) == false) { JavascriptUtils.writeJavascriptUrl(getResponse(), url, id); markRendered(token1);

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            John Patterson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development