VMware Cloud Community
jernejj
Contributor
Contributor

vcac presentation - databinding optimization

I have a dual-list input (type array(string)) and action that does some processing with that input. Action results are displayed on presentation as readonly input (via databinding). Action is time consuming so I have moved result display to next step and added new boolean input run that is also databinded to action. If run=false then action returns immediately, otherwise input is processed.

Action is now invoked every time that input is changed, but even with run=false the delay in UI is noticeably (~500ms and loading gif animation). Can this be changed in a way that the action will be called only once - when entering next step or when setting run=true?

1 Reply
jernejj
Contributor
Contributor

I found a way, if someone is interested.

You need to download xaas-blueprint from vra (using cloudclient) and manually update yaml file. For "problematic" input change refreshOnChange to false. It looks like that vra automatically sets this to true for inputs that are used as parameters for data-binded actions (but there is no UI to change that back). This will cause that page will not be refreshed after input is updated, but that is exactly what we want.

Run parameter is still required since we will leave refreshOnChange = true and updating run parameter will trigger action.

Additionally, if you do not want to change your action with "run" parameter as input, than bind action with expression:

(#run : GetAction("module","action").call(#input) : " ")