select widget does not take "Returned key" configuration

1
+1
-1

Bonita BPM 7.2.2

There's a select in a form which "Available values" bind to a JSON variable with value of:
[
{"uid":"1a", "label":"Bonita BPM"},
{"uid":"2b", "label":"WeChat CRM"},
{"uid":"3c", "label":"Talend ESB"}
]

Displayed key is set to label, and Returned Key to uid.

But, when I bind this widget to a contract variable with initial value, select does not show that particular option.

In generated HTML code, uid is not used as option value:

<select class="form-control ng-pristine ng-valid ng-valid-required ng-touched" name="pbSelect0" ng-model="properties.value" ng-options="ctrl.getValue(option) as ctrl.getLabel(option) for option in properties.availableValues" ng-required="properties.required" ng-disabled="properties.disabled"><option style="display:none" value="" class="ng-binding">
Select an option
</option>
<option value="0" label="Bonita BPM">Bonita BPM</option>
<option value="1" label="WeChat CRM">WeChat CRM</option>
<option value="2" label="Talend ESB">Talend ESB</option>
</select>

1 answer

1
-1
-1

Not sure if this answers your question but try this. In the UI Designer, make sure you don't check the fx button to put in your return key.

Here is how I set mine up:

Select Widget
Available values: myVariableContainingListOfItems (fx checked) (no {{}} brackets, no quotes )
Display key: myLabelForSelect (fx not checked) (no {{}} brackets, no quotes )
Returned key: persistenceid (fx not checked) (no {{}} brackets, no quotes )
Value: selectedSelectValue

Variable
Name: myVariableContainingListOfItems
Value: a call to my businessData
Returned Value: [{"persistenceid": 1, "myLabelForSelect", ...}]

Variable
Name: selectedSelectValue

Comments

Submitted by xslaprazor on Sat, 01/14/2017 - 10:19

Hello, I tried this solution, but it's not working for me.
I want to create a Dropdown, that Displays all the data from a Business Data ModelTable called "Customer".
I created a custom querry to get all the IDs (called getAllIDs):
SELECT persistenceId
FROM Customer
On my form I created a variable with the following external API:
../API/bdm/businessData/de.test.model.Customer?q=getAllIDs
In the Dropdown I selected then uses this vaiable in the "Available values" field and I enterd PERSISTENCEID as the "Displayed key" and as the "Returned Key".
But I'm still not getting any values!?

Notifications