0

By following this link Alfresco custom control in stencil i have made custom multi select control with the same steps as mention in the post (Alfresco Activiti) , multi select works fine but problem i am facing rite now in visibility operation is not working of the control for example there is a text field and in its visibility section i am applying condition whenever value of multi select control value is middle and high hide this control as mentioned in the attached image.enter image description here . code for multi select custom control is

<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 controller code is

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

help me in this regard.

Ali
  • 557
  • 1
  • 9
  • 30

1 Answers1

0

Likely this is because your visibility code is not expecting an array. You need to test for array contains rather than equal and not equal.

Greg Harley
  • 3,230
  • 1
  • 11
  • 14
  • Harley , there is no such option of contains in visibility section , will you help me this regard how to achieve this thing? – Ali Jul 26 '17 at 09:46
  • I think this is a non trivial problem. What I would do to address it is to include new Javascript that is triggered by the formFieldUpdated event. Test the field is your custom selector and then programmatically set the visibility of the other input field from the script. Shouldnt be too hard to achieve. – Greg Harley Jul 26 '17 at 18:26