could you tell what's the "right" way to define VM variable which can be
used in the JSX object code?

in my_jsx_doc, i put
#set($my_var = "my_val")

and in the JSX code in the object being in the my_jsx_doc, i have

doit(${my_var}) or doit("${my_var}") or doit($myvar)

and either, I get a null exception or it keeps ${my_var}

thanks
Pascal

On Fri, Oct 17, 2008 at 11:25 AM, Sergiu Dumitriu <[EMAIL PROTECTED]> wrote:

> Pascal Voitot wrote:
> > Hello,
> > I create a JSX object with parse option enabled and in the code I put
> > something like:
> >
> > doit("${my_vm_variable}")
> >
> > in my XWiki doc, i put:
> >
> > #set($my_vm_variable = "my_value")
> > $xwiki.jsx.use("my_jsx_doc")
>
> This does not work because these two documents are parsed during
> different requests, so different velocity contexts.
>
> > But, the variables are not interpreted... (I also tried to put the
> variable
> > in the jsx doc but doesn't work either)
>
> This should work. Are you sure you're defining the variables the correct
> way? Also make sure the page was not cached. During development I use a
> "forbid" cache policy to make sure I don't see stale pages.
>
> > I may misunderstand something :)
>
> Well, "parse" is supposed to do what you said, parse the content using
> velocity. Just keep in mind that it is parsed in a separate, clean
> context, just with the bare variables in it: $doc, $request, $response,
> $xwiki, $context, $msg and a few others.
>
> > regards
> > Pascal
> > _______________________________________________
> > devs mailing list
> > [email protected]
> > http://lists.xwiki.org/mailman/listinfo/devs
> >
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to