Setting Async data to comboBox in Properties Panel


#1

i am trying to change assignee from text box to custom drop down. for that making an XMLHttpRequest and assigning response to Drop down.But value are not binding to drop down. my code is like below

    group.entries.push(entryFactory.selectBox({
            id: 'assignee',
            label: 'Assignee',
            selectOptions: function (element, node) {
                var arrValues = []
                $.ajax({
                    url: "http://localhost:8283/employees",
                    method: "GET",
                    headers: {
                        "mineId": "4",
                        "apiKey": "9e55fd91-e0cb-43f3-89a7-fa64d1eaf43d"
                    },
                    success: function (result) {
                        arrValues = result;
                    },
                    async: false
                });
                return arrValues;
            },
            modelProperty: 'assignee',
            setControlValue: true
			})
})

this entry is getting undefined because of service call response time.
Any help should be appreciated.


#2

This question has been asked and answered before:


#3

Hi @philippfromme i have tried that example but still lazy loaded data is not binding to properties panel, After setControlValue function executed service is returning data so its not binding. providing a small example will be very helpful.


#4

@nagu Could you share, how you tried facilitating setControlValue?


#5

Hi @nikku,
Here is my sample project and i am able to override getTabs method of PropertiesProvider and changing userTask’s Assignee from text box to dropdown with static data.But when i am trying to load dynamic data it is failing. when i replace selectOptions to lazy loaded data in rtCamundaPropertiesProvider.ts file like below

    private loadEntry() {
        return entryFactory.selectBox({
            id: 'assignee',
            label: 'Assignee',
            modelProperty: 'assignee',
            emptyParameter: true,
            selectOptions: function () {
                setTimeout(() => {
                    return [{ name: "Nagu", value: "1" }, { name: "John", value: "2" }, { name: "Philip", value: "3" }]
                }, 1000);
            },
            // [{ name: "Nagu", value: "2" }, { name: "John", value: "1" }, { name: "Philip", value: "3" }],
            setControlValue: true
        });
    }

properties panel is not loading.


#6

I’m also having the same situation, any solution?


#7

Populate fields dynamically issue is still open. Is it something we can expect in upcoming release?

Appreciate status on this.