Last week in Stockholm norpe showed me how to add a progress indicator Adorner to a ListView when I call an M3 API in a background thread in a Personalized Script for Lawson Smart Office. When I execute a time consuming operation I like to maintain good usability by indicating activity to the user. For that, I used to display a message to the user in a Label like “Loading please wait…”, but that doesn’t catch the eye very well, and/or I used to changed the mouse cursor to Cursor.Wait. but I think that’s a shared resource. So I prefer this new technique.
It’s only two lines of code from Mango.UI.Controls:
ProgressIndicatorAdorner.AddAdorner(element, useOpacity, scaleFactor); ProgressIndicatorAdorner.RemoveAdorner(element);
Here’s the method’s signature:
3 thoughts on “Progress indicator adorner”
Great stuff as always Thibaud! ….I used the adorner successfully on a Button element while performing background work.
Guten Tag Karl! I’m glad my post helped you 🙂 Thank Peter K for the solution. Looking forward to reading your next post.
UPDATE: To add the adorner to an M3 panel, call the method on element controller.RenderEngine.Host.HostContent; if used in panel B it will disable the list and its scrollviewer, at the bottom it will disable the panel sequence and navigation buttons, and at the top it will disable the Sorting Order, View, toolbar, and menu; great. However, the adorner doesn’t disable the keyboard shortcuts such as F5-Refresh; that would need to be handled in the event OnRequesting or something.