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