Wicket
  1. Wicket
  2. WICKET-5035

script tag with wicket:id does not throw exception if it was not added in the code

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.5.0
    • Fix Version/s: 6.6.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Have markup

      <wicket:panel>

      <b> this is my component</b>

      <script language="JavaScript" wicket:id="my-script">

      </script>

      </wicket:panel>

      and code

      public MyComponent(String id)

      { super(id); setOutputMarkupId(true); String script = getScript(); Label scriptLabel = new Label("my-script",script); scriptLabel.setEscapeModelStrings(false); //add( scriptLabel); }

      response simply contains empty CDATA for the script tag body without throwing exception that component is not added in the code

      <?xml version="1.0" encoding="UTF-8"?><ajax-response><component id="container5" encoding="wicket1" ><![CDATA[<div wicket:id="container" id="container5">
      <div wicket:id="replaceable" id="replaceable6"><wicket:panel>

      <b> this is my component</b>

      <script language="JavaScript" wicket:id="my-script">
      /<![CDATA[/

      /]]>/
      </script>

      </wicket:panel></div>
      </div>]]></component></ajax-response>

      adding label in the code adds script body as expected.

      repro project attached

      1. wicket-extra-caret.tgz
        10 kB
        Konstantin Ignatyev

        Activity

        Hide
        Sven Meier added a comment -

        a script or style tag with wicket:id will now fail if no component can be resolved

        Show
        Sven Meier added a comment - a script or style tag with wicket:id will now fail if no component can be resolved

          People

          • Assignee:
            Sven Meier
            Reporter:
            Konstantin Ignatyev
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development