AnsweredAssumed Answered

Custom form stencils: How to pass customParameter to controller?

Question asked by mario.fliegner on Nov 8, 2017
Latest reply on Nov 9, 2017 by mario.fliegner

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

Attachments

Outcomes