Hi,

To access to velocity variables from your javascript extension, you need to
enable "Parse content" option of the JavaScriptExtension object.
That means that your javascript code will be processed by velocity when
page is rendered.

Then to share a variable between your page and the javascript extension,
you can use:

## in macro
$xcontext.put("param", "$xcontext.macro.parameter.foo")

// in javascript extension
def param = "$xcontext.get("param")";



Note: I didn't test that, so I don't know if it works - maybe there's a
different way to do.

BR,
Jeremie



2014-05-12 19:00 GMT+02:00 Eduardo Abritta <eduardo.abri...@outlook.com>:

> Hi Sirs,
>
> I am developing a macro in velocity (wiki macro) and need to use a
> parameter (wiki macro parameter) defined by the user in my java script code
> (java script extension). I tried  can several methods but it is not working.
>
> How can I do this?
>
>
>
>
> Atenciosamente,
> Eduardo Abritta
> e-mail: eduardo.abri...@outlook.com |
>
>
>
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to