How to change

add(JavascriptPackageResource.getHeaderContribution(this.getClass(),
  "js/lightbox.js"));

so that variables inside "lightbox.js" are replace on delivery?

I tried something like this:

PackagedTextTemplate jsTemplate = new PackagedTextTemplate(this
                                .getClass(), "js/lightbox.js");
TextTemplateSharedResourceFactory resourceReference = new
TextTemplateSharedResourceFactory(jsTemplate, this.getClass());

String webappContext = WebApplication.get().getServletContext()
                                .getContextPath();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("webappContext", webappContext);
TextTemplateLink ref = new TextTemplateLink("", resourceReference,
                                parameters);
??? what to do with link ???

or when I try

...
add(TextTemplateHeaderContributor.forJavaScript(jsTemplate, new
Model((Serializable) parameters)));

the content is rendered into head, what I do not want.
I just want a header contribution to a parsed template like this:
<script type="text/javascript" src="..."></script>

Any ideas?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to