return {
restrict: 'E',
scope: {
model: '=svyModel',
handlers: "=svyHandlers",
api: "=svyApi",
svyServoyapi: "="
},
controller: function($scope, $element, $attrs,$window) {
if($scope.model.Valuelist!=undefined&&$scope.model.dataproviderID!=undefined){
$scope.value=$scope.model.Valuelist[$scope.model.dataproviderID].realValue;
}
$scope.selectBox = {
dataSourceUsage: {
dataSource: new DevExpress.data.ArrayStore({
data: $scope.model.Valuelist,
key: "realValue"
}),
displayExpr: "displayValue",
valueExpr: "realValue",
hint:$scope.model.hint,
value:$scope.value,
validationMessageMode:"always",
validationError:{type:'required',message:$scope.model.validationMessage},
onFocusOut:function(event){
$scope.handlers.onFocusLostMethodID($scope.value || "no value");
},
onFocusIn:function(event){
$scope.handlers.onFocusGainedMethodID($scope.value || "no value")
},
onValueChanged:function(company_id){
//if($scope.handlers.onActionMethodID!=undefined){
$scope.value = company_id.value;
$scope.handlers.onActionMethodID(company_id.value);
$scope.svyServoyapi.apply('dataProviderID');
//}
},
bindingOptions: {
disabled: '!model.enabled',
isValid: 'model.isValid',
rtlEnabled: 'model.rtlEnabled',
}
}
};
"size": { "type" :"dimension", "default" : {"width": 140, "height": 35} },
"dataproviderID" : { "type":"dataprovider", "pushToServer": "allow","tags": { "scope" :"design" }, "ondatachange": { "onchange":"onValueChanged", "callback":"onDataChangeCallback"}},
"enabled" : { "type": "enabled", "blockingOn": false, "default": true, "for": ["dataProviderID","onValueChanged","onKeyPressMethodID"] },
"styleClass" : { "type" :"styleclass", "tags": { "scope" :"design" }},
"visible" : "visible",
"Valuelist":{"type":"valuelist", "tags": { "scope" :"design" },"pushToServer":"allow",
onValueChanged:function(company_id){
//if($scope.handlers.onActionMethodID!=undefined){
$scope.value = company_id.value;
$scope.handlers.onActionMethodID(company_id.value);
$scope.svyServoyapi.apply('dataProviderID');
//}
}
onValueChanged:function(company_id){
$scope.value = company_id.value; //
$scope.svyServoyapi.apply('dataproviderID'); // i suggest to rename the property in .spec file to 'dataProviderID' to keep it consistent with all other components
// check if there is an handler, if yes execute the handler.
if ($scope.handlers.onActionMethodID){
$scope.handlers.onActionMethodID(company_id.value);
}
}
Valuelist: article_XXXX used with different types
The valuelist was already created for type: INTEGER
for the dataproviders: Milan
So it can't be used also for type: TEXT for the dataprovider: null
Please edit these dataprovider(s) (using table editor for database column or Edit variable context menu action for variables) of this valuelist: article_XXXX so that they have the same type.
"size": { "type" :"dimension", "default" : {"width": 140, "height": 35} },
"dataproviderID" : { "type":"dataprovider", "pushToServer": "allow","tags": { "scope" :"design" }, "ondatachange": { "onchange":"onValueChanged", "callback":"onDataChangeCallback"}},
"enabled" : { "type": "enabled", "blockingOn": false, "default": true, "for": ["dataProviderID","onValueChanged","onKeyPressMethodID"] },
"styleClass" : { "type" :"styleclass", "tags": { "scope" :"design" }},
"visible" : "visible",
"Valuelist":{"type":"valuelist", "tags": { "scope" :"design" },"pushToServer":"allow","dynamicDataproviders":true,"provideColumnFormats":true, "for": ["dataproviderID","onActionMethodID","onDataChangeMethodID"]},
ashutoslenka426 wrote:This happens when I try to assign the valuelist to the combobox.
Users browsing this forum: No registered users and 24 guests