"Select All" component within a form
search cancel

"Select All" component within a form

book

Article ID: 271446

calendar_today

Updated On:

Products

CA Service Catalog

Issue/Introduction

Is it possible to allow a user the option to "Select All" in a select field/component where "multiple select" is enabled. 

Currently, the user would need to click/select one item at a time in a select field.

Environment

CA Service Catalog 17.x

All Supported Operating Systems

Resolution

This can be achieved by using the formAPIs and using label components as below

Form Script:
{
  selectAll: function(){
    ca_fdUnselectAllOptions('form1','sel_1');
    var options = ca_fdGetOptions('form1','sel_1');
    for(var i=0;i<options.length;i++){
      ca_fdSelectOptionByIndex('form1','sel_1',i);
    }
  },
    unselectAll: function(){
      ca_fdUnselectAllOptions('form1','sel_1');
    }
}

Attached to this KB article is the exported demo form with above changes

Attachments

1691664667311__ixutil_form_SelectAllDemoForm.xml get_app