alfresco activiti模具中的自定义多选控件
通过以下链接,我使用与《后露天活动》中提到的相同步骤创建了自定义多选控件,multi-select工作正常,但我现在在可见性操作中面临的问题是控件不起作用,例如,有一个文本字段,在其可见性部分,每当multi-select控件值的值为中高时,我都会应用条件隐藏此控件,如所附图像中所述。多选自定义控件的代码为alfresco activiti模具中的自定义多选控件,alfresco,activiti,stencils,Alfresco,Activiti,Stencils,通过以下链接,我使用与《后露天活动》中提到的相同步骤创建了自定义多选控件,multi-select工作正常,但我现在在可见性操作中面临的问题是控件不起作用,例如,有一个文本字段,在其可见性部分,每当multi-select控件值的值为中高时,我都会应用条件隐藏此控件,如所附图像中所述。多选自定义控件的代码为 <div ng-controller="multiselectController"> <select name="multiselect" multiple
<div ng-controller="multiselectController">
<select name="multiselect" multiple ng-model="field.value"
ng-options="option.code as option.name for option in field.options"
class="form-control ng-pristine ng-valid ng-scope ng-valid-required ng-touched"
>
<option value="">--Select State--</option>
</select>
</div>
角度控制器代码为
angular
.module('activitiApp')
.controller('multiselectController',
['$rootScope', '$scope', '$http',
function ($rootScope, $scope, $http) {
// that responds with JSON
$scope.field.options = [];
// in case of array values without rest services
if($scope.field.params.customProperties.ElxwfOptionsArrayMultiselect){
$scope.field.options = JSON.parse($scope.field.params.customProperties.ElxwfOptionsArrayMultiselect);
} else($scope.field.params.customProperties.ElxwfRestURLforMultiselect) {
$http.get($scope.field.params.customProperties.ElxwfRestURLforMultiselect).
success(function(data, status, headers, config) {
var tempResponseArray = data.RestResponse.result;
for (var i = 0; i < tempResponseArray.length; i++) {
var state = { name: tempResponseArray[i].name };
$scope.data.states.push(state);
}
}).
error(function(data, status, headers, config) {
alert('Error: '+ status);
tempResponseArray = [];
}
);
}
}]
);
在这方面请帮助我。这可能是因为您的可见性代码不需要数组。
您需要测试数组包含,而不是相等和不相等。Harley,在可见性部分中没有包含的选项,您能帮助我在这方面如何实现这一点吗?我认为这是一个非常重要的问题。我要做的是包含由formFieldUpdated事件触发的新Javascript。测试字段是否为自定义选择器,然后通过编程从脚本中设置其他输入字段的可见性。不应该太难实现。