What, you're deciding between Wicket and JSF and no one has answered
your question? Unacceptable!

JavaScriptTemplate is good for passing variables into Javascript. You
can use a cache buster to make sure it gets loaded each time. So, with
that approach you would have a plain onclick="oldJavaScript(foo);" in
your page template because foo has already been set in the external js
template.

A quicker and dirtier approach is to use an AttributeModifier for
"onclick" to patch together the full script call during page generation.
 Using an anonymous subclass model: new AbstractReadOnlyModel() { ...
getObject(...) { return "oldJavaScript(" + foo + ");"; }} And so on.

Nathan


> What sort of options are there for embedding simple scalar values into
> an html page, particularly into the parameters of an existing
> javascript method?  I'm looking for something along the lines of:
> 
> onclick=oldJavaScript(<wicket:scalar wicket:id="foo"/>);
> 
> Which is then rendered as
> 
> onclick=oldJavaScript(1234);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to