Q: How to mix js
and velocity
code inside jQuery
function?
require(['jquery'], function ($) {
var doc = "$escapetool.javascript($request.getParameter('hdwDoc'))";
function switcher(value) {
var hdwSubType = jQuery('#hdwSubType');
hdwSubType.hide();
switch(value) {
case '0':
#set($field = doc.getxWikiClass().get("hdwSubType"));
#set($field.propertyClass.values = "val1|val2|val3");
hdwSubType.show();
break;
default:
// code block
}
}
});
A: Impossible (or not?)
Q: When i try to use AJAX
, filling Custom Display
property by
{{velocity}}
#if($context.action == 'edit')
#set($subTypeValues = $request.getParameter('subTypeValues'))
#set($field.propertyClass.values = $subTypeValues)
#end
{{/velocity}}
the field becomes inaccessible
So, howto dynamically set StaticList
values from jsx
?
Thanks…