You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vinayak Borkar <vb...@yahoo.com> on 2008/11/22 06:44:49 UTC
Passing simple data between java code and the template
Hi,
I have some Javascript code in one of my pages. I want to keep this JS
in the template file. However, this JS has a variable whose value is
derived from a page parameter.
For example,
Is there a way I can do something like, ${value} in the template file
and have the actual value be substituted by wicket?
What is the best practice to have simple values substituted in templates?
Thanks,
Vinayak
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Passing simple data between java code and the template
Posted by James Carman <ja...@carmanconsulting.com>.
Try using TextTemplate? I've just created a WIKI page that outlines
how to do so for a CSS file. Perhaps you could borrow some of that
for a JS template (or write your own WIKI page as a result). The key
piece you want to look for is how it creates the PackagedTextTemplate
and supplies values to it.
http://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html
On Sat, Nov 22, 2008 at 12:44 AM, Vinayak Borkar <vb...@yahoo.com> wrote:
> Hi,
>
> I have some Javascript code in one of my pages. I want to keep this JS in
> the template file. However, this JS has a variable whose value is derived
> from a page parameter.
>
> For example,
> Is there a way I can do something like, ${value} in the template file and
> have the actual value be substituted by wicket?
>
> What is the best practice to have simple values substituted in templates?
>
> Thanks,
> Vinayak
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org