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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.5.0
    • 6.6.0
    • wicket
    • 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

      Attachments

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

        Activity

          People

            svenmeier Sven Meier
            kgignatyev Konstantin Ignatyev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: