Hi,
I'm trying to write some javascript in a page's markup (subclass of another
page using <wicket:child>/<wicket:extend> mechanism)
via JavascriptUtils.writeJavascript().

The fact is it doesn't do anything at all nor I can't find anything related
in the stack trace (the page displays well with no exceptions nor problems
at all),
the expected javascript is simply not in the generated markup.
Before calling JavascriptUtils I add a form to the page (which works
normally as expected).

The actual code looks like:

---
public class MyPage extends MyBasePage
{
     public MyPage()
     {
         add( new MyForm( "formid" ));
         String js = "... javascript code here ...";
         JavascriptUtils.writeJavascript( getResponse(), js);
     }
}
---

Can anyone please help ? Should I maybe use something else instead of
getResponse() ?
I expected that the javascript would have been written before the
</wicket:extend> closing tag, or wherever but it's not in the markup at all.
I'm using wicket 1.3.5 on tomcat 6 and jdk 1.6.

Reza Marvan Spagnolo

Reply via email to