I am able to make custom dropdowns based on custom values as shown below.. However, I want to be able to make those dropdowns to have multiselect option. How can I achieve applying the multiselect option?
attributes:{
"DslamPorts": {
"dataValueType": Terrasoft.DataValueType.ENUM,
"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
"caption": { "bindTo": "Resources.Strings.DslamPortsCaption" }
},
"DslamPortsList": {
"dataValueType": Terrasoft.DataValueType.ENUM,
"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
"isCollection": true,
"caption": { "bindTo": "Resources.Strings.DslamPortsCaption" }
},
},
diff: {
"operation": "insert",
"name": "DslamPorts",
"values": {
"caption": "Dslam Free Ports",
"dataValueType": 11,
"bindTo": "DslamPorts",
"layout": {
"colSpan": 11,
"rowSpan": 1,
"column": 0,
"row": 1,
"layoutName": "Info"
},
"controlConfig": {
"className": "Terrasoft.ComboBoxEdit",
"list": {
"bindTo": "DslamPortsList"
},
"change": {
"bindTo": "onDslamPortsChange"
},
"prepareList": {
"bindTo": "GetDslamPorts"
}
}
},
"parentName": "Info",
"propertyName": "items",
"index": 2
},
},
methods:{
onPageInitialized: function (callback, scope) {
this.callParent(arguments);var serviceData = {
phoneNumber: this.get("StPhoneNumber")
};
this.showBodyMask();
ServiceHelper.callService("StADSLServices", "GetFreeDSLAMPorts",
function (response, success) {
this.hideBodyMask();
var result = response.GetFreeDSLAMPortsResult;
debugger;
var jsonData = JSON.parse(result);
if(jsonData!=null && jsonData.length>0)
{
requestTypesddl = jsonData;
this.populatePrimaryDslamList(list,requestTypesddl);
}else{
this.set("isWaitingListVisible",true);
}
}, serviceData, this);
}
GetDslamPorts : function(filter, list){
this.populatePrimaryDslamList(list,requestTypesddl);
},
populatePrimaryDslamList: function (list, elements) {
if (list === null) {
return;
}
list.clear();
var columns = {};
for (var x = 0; x < elements.length; x++) {
var value1 = {
displayValue: elements[x].Name.toString(),
value:elements[x].Id.toString()
};
columns[x] = value1;
}
list.loadAll(columns);
},
onDslamPortsChange :function(args){
this.set("StNewReservedPort",args.displayValue);
},
}
Like
Dear Mohammad,
Firstly, please take into account, that per one lookup on the page, you will be able to store one value. A field is just a cell in a table. In order to process multiple values you need either write your own JS code or use a detail.
The connection is "one-to-one" and you need "one-to-many". The only place that allow inserting multiple values related to a single record that called "one-to-many" - is a detail. Please consider using a detail functionality for that.
The detail with the multiple selection would be the closest thing you can get:
https://academy.bpmonline.com/documents/technic-sdk/7-12/creating-detai…
You will be able to place a detail on a page and select multiple entities.
Regards,
Anastasia