Passing Informed Data in the UI Designer Form to an ArrayList

1
0
-1

I have a form that was created in BonitaSoft's UI Designer, where I display the products that the customer can select to want to buy, but if he wants to buy more than one type of product I'm having difficulty passing this information to my business variables.

So I thought I'd save this information in an ArrayList and then pass that information on to the business variables, but I do not think I can do it with the variables that are posted to UI Designer.

If you have any idea how I can do this, it will be very well accepted.

1 answer

1
0
-1

Yes it's a pain that it's not possible to return a [list] but that's the way it is...however this is what we do:

In our contract we have variable checkedItemsString as type TEXT

In the UI form we:

have a checkedItemsString variable as type String (this is where the Checked Items are stored (checklist widget parameter Selected Values)

we then modify the formOutput variable as follows:

from:

return {
        'checkedItem': $data.formInput.checkedItemsString
};

to:

return {
        'checkedItem': $data.checkedItemsString.toString()
};

This will return the array as a string, when you do your actions you can then use

.split(",")

to create a [list] of the selected items...hope this helps

regards
Seán

PS: As this reply answers your question, please mark as resolved.

Notifications