[xwiki-users] Using parameter macro in the js extension

2014-05-12 Thread Eduardo Abritta
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

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-12 Thread Jeremie BOUSQUET
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

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-12 Thread Michael Bußler
Hi, the velocity-code is executed on the server, while js-code runs on the client side, AFTER the macro-code was executed . You could try need to pass parameters to your macro via an URL parameter or http POST. Hope this helps! Best, Michael Am 12.05.2014 19:01 schrieb "Eduardo Abritta" : > Hi S

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-13 Thread Jeremie BOUSQUET
Hi, 2014-05-13 8:40 GMT+02:00 Michael Bußler : > Hi, the velocity-code is executed on the server, while js-code runs on the > client side, AFTER the macro-code was executed . > You could try need to pass parameters to your macro via an URL parameter or > http POST. > Only if value needs to be r

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-13 Thread Eduardo Abritta
m: jeremie.bousq...@gmail.com > To: users@xwiki.org > Subject: Re: [xwiki-users] Using parameter macro in the js extension > > Hi, > > > 2014-05-13 8:40 GMT+02:00 Michael Bußler : > > > Hi, the velocity-code is executed on the server, while js-code runs on the > > cl

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-13 Thread Caleb James DeLisle
This depends a lot on how the javascript is loaded... If you're including it using $xwiki.jsx.use() then it won't have the same context because it's a different HTTP request. If you use the macro and then do a {{velocity}} macro with an {{html}} macro and a

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-13 Thread Jeremie BOUSQUET
2014-05-13 16:04 GMT+02:00 Caleb James DeLisle : > This depends a lot on how the javascript is loaded... > > If you're including it using $xwiki.jsx.use() then it won't have the same > context because it's a different HTTP request. If you use the macro and > then > do a {{velocity}} macro with an

Re: [xwiki-users] Using parameter macro in the js extension

2014-05-13 Thread Eduardo Abritta
Caleb, I did what do you say and it worked. Thank you. Atenciosamente, Eduardo Abritta e-mail: eduardo.abri...@outlook.com | > Date: Tue, 13 May 2014 16:19:17 +0200 > From: jeremie.bousq...@gmail.com > To: users@xwiki.org > Subject: Re: [xwiki-users] Using parameter mac