alfresco activiti stencil中的自定义多选控件

时间:2017-07-23 18:52:55

标签: alfresco activiti stencils

通过以下链接Alfresco custom control in stencil我已经使用与帖子中提到的相同步骤(Alfresco Activiti)进行了自定义多选控制,多选工作正常,但我现在在可见性操作中面临的问题是不起作用控件例如有一个文本字段,在其可见性部分我正在应用条件,只要多选控制值的值隐藏此控件,如上所述附图。enter image description here。多选自定义控件的代码是

<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 = [];
                }
            );      
       } 

   }]
);

enter image description here

在这方面帮助我。

1 个答案:

答案 0 :(得分:0)

可能这是因为您的可见性代码不期望数组。 您需要测试数组包含而不是相等且不相等。

相关问题