Hi guys,
yet another question regarding custom form stencils (related to my other question from today). I've created my own form stencil that return some values from a webservice. Now I want to make it a bit more flexible but I stuck with the stencil properties. For example, I want to provide a textfield that should contain the base URL of my webservice. I've created the property (type: "Text"), I can see it in the process definition and finally, the value of it is even available in the task. If I put the following line in my runtime template, the correct value will be printed:
<span>{{field.params.customProperties.myWebserviceURL}}</span>
// I see my specified value like: http://localhost:8080
What I'm now looking for, is to pass this value to my controller script and what I've tried so far is to use the ng-init for that:
<select ... ng-model="myCompanyCode"
ng-init="init('{{field.params.customProperties.myWebserviceURL}}')"></select>
and in the controller script:
$scope.init = function(url){
console.log("Passed URL: " + url);
$scope.myWebserviceURL = url;
};
Unfortunately, I get the full parameter name in the function, meaning {{field.params.customProperties.myWebserviceURL}} and not the translated value as in the runtime template: http://localhost:8080). If I remove the single quotes in the function call, I get a parse error...
ng-init="init({{field.params.customProperties.connexas4processWebserviceURL}})"
Any ideas how to pass these parameters, so that I can use it in the controller?
And another question, maybe Ciju Joseph can answer this: Will it be possible in a future release to have more property types available that can be used for custom properties? Right now I can use "Text", "Text (multi line)" and "Variable" but at least it would be nice (necessary?) to have the capability to create parameters for "Radio Button", "Checkbox" and even "Dropdown" as well!?
BR,
Mario
Solved! Go to Solution.
Can you not get it from $scope.field.params.customProperties.... directly in the controller?
Regarding the roadmap question, I'm not sure if that is planned or not. I recommend you to contact your account representative if you would like a roadmap session from PM team. Or feel free to raise a feature request via the support portal for adding more types in the future!
Ciju
Can you not get it from $scope.field.params.customProperties.... directly in the controller?
Regarding the roadmap question, I'm not sure if that is planned or not. I recommend you to contact your account representative if you would like a roadmap session from PM team. Or feel free to raise a feature request via the support portal for adding more types in the future!
Ciju
Thanks again Ciju,
Yes, now I'm able to access the properties from the $scope object. Not sure why it hasn't worked yesterday. The solution was maybe to restart my computer, open the windows in the office and bring my junior to the kindergarten by car. That's all I've done today so far... and now it works...
For the roadmap, I will raise an issue in the partner portal.
BR,
Mario
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.