I'm working with several forms and struggle with Velocity code
organisation.
1. I'd like to put the same code for e.g. regexp form validation in one
page and just include it from other (ClassSheet) pages. Following
http://platform.xwiki.org/xwiki/bin/view/DevGuide/Creating+a+form+with
+validation+and+tooltips valdidation works fine, when
#macro(showallerrors) macro is included in ClassSheet page, though it
doesn't work, when macro in ClassSheet is included from other file (e.g.
putting macro in VelocityScripts page and writing in ClassSheet:
{{include reference="VelocityScripts"/}} or {{include document...)
It works though, if macro is put in ../xwiki/templates/macros.vm file.
2. As velocity cannot use passing variables by reference, I'd like to
create own "global" velocity variable similar to $isGuest, $hasComment,
$hasAdmin, etc. I tried to set this in xwikivars.vm, but it didn't
work.
Any suggestions are welcome.
Thanks!
Valdis