I am having a problem with showing a heavy tab in one of the forms in our application. We are using it2Be calendar bean for our visual scheduler module and the bean is a heavy bean. When we open the form that has the bean on it (specially the first time) the form window comes up and it takes around 10-15 seconds to load the bean on it. This process visually doesn’t look appealing and some times makes the user think that the application is frozen and they start to panic. To address this issue we tried a few ways including using progress bar in dialogPro plugin or having another form with a ajax spinner to show on top of the loading form while the forms is loading the bean but none of them seems to work. The problem is not with showing the progress bar or the spinner but to have them moving while the other form (in this case form with the calendar bean) is loading. The progress-bar/spinner starts the animation, but the moment my main form wants to show the tab that has the calendar on it, the whole application freezes and all those animations etc. simply stop till the form is finished loading. The problem is not just with the form having the calendar bean, but when showing any heavy form (although in other situations it’s less obvious as they don’t take 10 seconds to load).
I was wondering if someone else has a similar problem with showing heavy forms and the UI freeze? How can we overcome this problem?
Please start investigating, how big the dataset is, you set in the calendarbean.
We always show (and query) only the data, that is visible in the view (a day, 5 day’s 7 day’s or month view)
If you don’t do that, the bean will take a lot of time, to first gather the data.
We use the calendarbean also in a tab, and in our case, the bean loads with data, always between 1-3 seconds
Also use the debugger, or profiler, or in the servoy-admin page, the performance tab, to investigate, what takes so long.
that will give you a lot more pointers and insights.
When the dataset you use is big then it is like Harjo says.
The bean will first have to load the dataset and will display it after that.
The larger the dataset the longer loading time will be.
But not only that you will also consume more memory.
When your dataset is not so big chances are that you make another mistake.
I have seen cases where the dataset was created using foundsets/relations where the data was making roundtrips causing an enormous delay.
Harjo:
Please start investigating, how big the dataset is, you set in the calendarbean.
We always show (and query) only the data, that is visible in the view (a day, 5 day’s 7 day’s or month view)
If you don’t do that, the bean will take a lot of time, to first gather the data.
We use the calendarbean also in a tab, and in our case, the bean loads with data, always between 1-3 seconds
Also use the debugger, or profiler, or in the servoy-admin page, the performance tab, to investigate, what takes so long.
that will give you a lot more pointers and insights.
Hi Harjo,
Thanks for your response. I also get the relevant data for the visible view. the problem is not with the amount of data as even when I have no records in my timesheets table to show, the calendar tab takes a lot of time to open. I have a lot of things going on inside the bean specially with the selection area (and the massive wait is just the first time that I’m loading the bean). The problem is with the first load of heavy forms in servoy in general (they can take up to 3 seconds to load too). The only thing I want to do is to show a user-friendly waiting progress/hourglass/spinner animation, so that when the user opens the module, he/she knows that the app is not frozen while he is waiting for the tab to be fully shown and functional.
When the dataset you use is big then it is like Harjo says.
The bean will first have to load the dataset and will display it after that.
The larger the dataset the longer loading time will be.
But not only that you will also consume more memory.
When your dataset is not so big chances are that you make another mistake.
I have seen cases where the dataset was created using foundsets/relations where the data was making roundtrips causing an enormous delay.
Hi Marcel,
I understand that the bean needs to load the data before it shows the calendar and as bigger as my dataset is, as longer as it takes for it to load the data. But I have tried to minimise the dataset size and still loading the bean takes some time (which is fine). The problem as I mentioned before is in general with heavy servoy forms. When you select a tab on a form that is a bit heavy, the app freezes for 1,2, 3 or some times more seconds so even when I have an animation going on on top of that form, the animations stops which defeats the whole purpose of having that animation in the first place!
for this to work the data load and maybe other stuff that it does must be off loaded to a different thread.
If this happens in the main event thread then any animation will be blocked.
Thanks for your reply. And how do you suggest me to off-load the data load to another thread? This can’t be done with Servoy as far as I know as servoy is single threaded, so do you suggest me using a plugin to do so? and if yes, how should it be implemented?
Or you could implement a function in your own plugin that calls blockGUI, releaseGUI from http://www.servoy.com/docs/public-api/7 … ccess.html
You call blockGUI before opening the form and this will block the UI and show the hourglass/spinner. When the load is done you call releaseGUI.
jbrancoIF:
You could check the busy plugin in ServoyForge: https://www.servoyforge.net/projects/busy. It can show a user-friendly waiting progress/hourglass/spinner.
Or you could implement a function in your own plugin that calls blockGUI, releaseGUI from http://www.servoy.com/docs/public-api/7 … ccess.html
You call blockGUI before opening the form and this will block the UI and show the hourglass/spinner. When the load is done you call releaseGUI.
Hi João,
I did not know that you can have a spinner (annimated gif) running using the busy plugin. Can you please let me know how to do so? I want to have the spinner to run on a different thread and not on the same thread that servoy solution runs.
And again with using blockUI and releaseUI, how can I have my animated gif to continue spinning while the page is loading (page load freezes the application for a couple of seconds some times)?