Is it possible to set macro parameter value from the macro code while executing macro?
something like $xcontext.macro.params.set(‘param1’) = ‘value’
I would like to store some value when macro is first executed, so i dont have to execute it everytime when macro is displayed.
Hi David, you cannot do that as the macro parameters are supposed to be read-only.
What you can do is save your data elsewhere. See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SavingData/
Thank you! My macro embeds content from another page - but that page requires InternalID
However my user only have ExternalID.
so I need my macro to call getInternalID(ExternalID) (js call) - but its not effective to call it every time the macro is displayed - so i want to do it only once and save it.
Does any other approach come to your mind to solve that?
Idea: if you’re client side (javascript) then you could save it in your browser local storage (HTML Web Storage API).
thats great idea. Thank you!