Progress Bar

Content under construction

The Progress Bar component shows a progress bar that can be used to indicate the progress of lengthy processes.

Example:

Table of contents

Progress Bar properties

Progress Bar properties can be found here

Progress Bar API

Progress Bar API methods can be found here

Updates the progress, optionally setting the given value text

To update the progress bar you should update the value of the progress bar.

elements.myProgressBar.value = 60;

Please note that runtime changes to element's properties are not pushed immediately to the UI. To reduce the number of the round-trip server to client, Servoy keep track of the runtime changes and push them to the client as soon the method thread is terminated or as soon an updateUI is forced. An updateUI can be explicitly invoked with application.updateUI().

The function below updates the progress bar only once the execution is terminated.

function onAction(event) {
 // UI is updated only when the the loop is over; there is 1 round-trip server to client
 for (var index = 0; index <= 100; index++) {
   elements.bs_progressbar.value = index;
   application.sleep(50);
 }
}

This function behave differently then the function above, updating the progress bar at each iteration.

function onAction(event) {
 // UI is updated at each iteration. There are 100 round-trip to server to client
 for (var index = 0; index <= 100; index++) {
   elements.bs_progressbar.value = index;
   application.updateUI();
   application.sleep(50);
 }
}

Last updated