Block UI
Last updated
Was this helpful?
Last updated
Was this helpful?
The svyBlockUI service in Servoy allows developers to block the user interface (UI) temporarily to indicate that an operation is in progress. The API allows you to help prevent user interactions during long-running tasks by displaying an overlay with a customizable message and/or spinner animation.
Key features:
Customizable Appearance: Choose from 11 different spinner styles, set overlay colors, and customize messages.
Progress Updates: Update the displayed message dynamically during the process.
User Interaction Prevention: The overlay blocks user input to prevent accidental interactions with the background UI.
Timeouts: Specify a duration to automatically hide the UI blocker after a set time.
Blocking the UI is especially useful in scenarios where user interaction needs to be paused while waiting for a background process or a long running process to complete. Common use cases include:
Running Reports:
When generating detailed reports, which may take a few seconds or minutes.
Use a spinner and a message like "Generating report, please wait..."
to keep users informed.
Batch Updates:
During bulk record updates or database operations, to avoid conflicts or errors caused by user input.
Example message: "Updating records, please do not close the application."
This example shows how to use svyBlockUI while processing a list of files, providing updates at each step of the process.
Explanation:
files
: A list of files representing the items to process in the operation.
Dynamic Updates:
Example message during execution: "Processing file2.txt (2 of 5)"
.
Perform file processing here!
: here goes the code for file operations
Output Logging: Each processed file name is logged using application.output
.
Note Several Block UI that were previously available are deprecated in Servoy Titanium. These properties may no longer have any visual effect. If you have a specific need to control these UI aspects in Titanium, we recommend creating a support ticket with Servoy to discuss your use case and possible solutions.
You can find a list of Block UI API methods .
Method: Displays the UI blocker with the message "Starting file processing...".
The method updates the message dynamically to show which file is being processed and its position in the list.
Method: Hides the UI blocker after all files are processed, signaling that the operation is complete.