UI5 Tips: Use of Binding Suspend
This tip may provide a way to solve issues with application performance or initial loading, in-case any screen has inputs with suggestion enabled.
Also incase you have any dynamic filter cases where your master list based on some dynamic values of another odata call.
In one of custom UI5 application, we are having around 6 input fields with f4 and suggestions enabled. It’s a mandate requirement from customer to have suggestion enabled for all inputs fields( Even for non-mandatory inputs) .
This leads to performance impact on initial load of the application and also not sure, whether the users will be filling the non-mandate inputs at real time.
However noticed all the suggestions oData entities were getting called while loading the application initially.
So decided to bind the suggestion aggregation only when user starts type any char into the input fields. With this, able to avoid the initial application delays and unnecessary oData calls to backend system.
Power of UI5 Binding:
I was able to achieve this by using the power of UI5 binding.
Initial binding of suggestions aggregation will be as show below :
As explained on link, this will not trigger any events since the binding is suspended state. When user types, the suggest event will be trigged and enabled suggestion binding as below.
We shall use the power of binding “suspend/resume” property to ease development time and code optimisation.
- By this way, we shall able to achieve the dynamic filter applying to list and table.
- Avoid performance issues with input suggestions