11
|
1 [%
|
|
2 BLOCK INIT;
|
|
3 document.dojo.modules.push("dijit/form/CheckBox");
|
|
4 END;
|
|
5 IF metadata.inputType == 'password';
|
|
6 value = '';
|
|
7 ELSE;
|
|
8 value = metadata.inputValue;
|
|
9 END;
|
|
10
|
|
11 selected = {};
|
|
12
|
|
13 FOREACH item IN metadata.inputValue;
|
|
14 selected.${item} = 1;
|
|
15 END;
|
|
16
|
|
17 options = [];
|
|
18 valueField = "roleName";
|
|
19 labelField = "roleName";
|
|
20
|
|
21 FOREACH item IN resource.GetDataSource(metadata.GetSchemaProperty('data-source-name')).data;
|
|
22 options.push({
|
|
23 label = item.$labelField,
|
|
24 value = item.$valueField,
|
|
25 selected = selected.${item.$labelField}
|
|
26 });
|
|
27 END;
|
|
28 %]
|
|
29 [% FOREACH option IN options %]
|
|
30 <div>
|
|
31 <input type="checkbox" name="$prefix" value="$option.value"[% IF option.selected %] checked="true"[% END %]/><span>$option.label</span>
|
|
32 </div>
|
|
33 [% END %] |