I am using Vaadin 8 and the LoadingIndicator is causing me some problems. For 90% of the time I need it to be set accordingly:
- 1st delay == 300ms
- 2nd delay == 600ms
- 3rd delay ==
Integer.MAX
But for some specific actions I need this to be modified, so that the Overlay (Loading Indicator) is displayed instantly, instead of waiting the preconfigured 300ms. For example when I click a button I want it to be displayed instantly. This, however, is problematic, because if I set the first delay to zero during the processing of the button click event, it is only applied after the event is finished. For this reason I want to execute some JS method, which would set this delay to zero. I have tried just straight up calling the JS method to display the overlay instantly, but it is still influenced by the LoadingIndicatorConfiguration.
Edit: At the moment, the working (not best) solution I came up with is to create a CSS class that mimics the v-loading-indicator
and create a JavaScript method that adds a div
element at the beginning of the body
element and then adds this CSS class to the div
element. Then when the button is being created I execute (again using JS - this is critical) addEventListener
on this div
and add the method to show the loading indicator.