Progressbar 96

0 views
Skip to first unread message

Gerald Weiß

unread,
Aug 5, 2024, 2:04:46 AM8/5/24
to cerroseemitz
Ifthe progressbar role is applied to an HTML element, the accessible name can come from the associated . Otherwise use aria-labelledby if a visible label is present or aria-label if a visible label is not present.

There are some types of user interface components that, when represented in a platform accessibility API, can only contain text. Accessibility APIs do not have a way of representing semantic elements contained in a progressbar. To deal with this limitation, browsers, automatically apply role presentation to all descendant elements of any progressbar element as it is a role that does not support semantic children.


It is recommended to use a native or elements rather than the progressbar role. User agents provide a stylize widget for the element based on the current value as it relates to the 0, the minimum value, and the max value. When using non-semantic elements, all features of the native semantic element need to be recreated with ARIA attributes, JavaScript and CSS.


If the progress bar is describing the loading progress of a particular region of a page, include the aria-describedby attribute to reference the progress bar's status, and set the aria-busy attribute to true on the region until it is finished loading.


And I want to hide/show it using the @ShowProgress variable what is the trick to making sure that when someone presses a button it shows the progress bar while a background action is taking place. I have tried it every which way but it's just not working async or sync and with or without StateHasChanged.


Then in the @code I am setting the value of the message. You could use really any variable but the main thing is to be sure to make the async calls properly so the control starts to move while your long running process is under way.


I think for me the problem is that my "code behind" isn't a partial class. It is inherited by the frontend.

The code behind inherits OwningComponentBase (in case this might be part of the problem).


@korchev

I have the same issue:

Click event of splitbutton "button export of crud page , added new option" .

Added a page property with value false .

set the page property value in the Load to false , set the page property to true in the click event of split button, then invoke a custom method .

The custom methods runs but the progressbar doesn't show or hide .


PS: searching the forum is quite cumbersome some times , and it is a great knowledge resource. sometimes the answers are there but difficult to find .

Could we mark As answer , or some more tags to make this easier to find.


Features:

- Can add progressbar to existing m-files with a single line of code.

- Supports multiple bars in one figure to show progress of nested loops.

- Optional labels on bars.

- Figure closes automatically when task is complete.

- Only one figure can exist so old figures don't clutter the desktop.

- Remaining time estimate is accurate even if the figure gets closed.

- Minimal execution time. Won't slow down code.

- Randomized color. When a programmer gets bored...


If your platform doesn't support ANSI codes, updates to the progressbar are added as new lines. To prevent the output from being flooded,use the minSecondsBetweenRedraws()method to limit the number of redraws and thesetRedrawFrequency() methodto redraw every N iterations. By default, redraw frequency is100ms or 10% of your max.


A progress bar format is a string that contains specific placeholders (a nameenclosed with the % character); the placeholders are replaced based on thecurrent progress of the bar. Here is a list of the built-in placeholders:


Notice the :6s part added to some placeholders? That's how you can tweakthe appearance of the bar (formatting and alignment). The part after the colon(:) is used to set the sprintf format of the string.


If you want to display some information that depends on the progress bardisplay that are not available in the list of built-in placeholders, you cancreate your own. Let's see how you can create a remaining_steps placeholderthat displays the number of remaining steps:


Progress bars define a placeholder called message to display arbitrarymessages. However, none of the built-in formats include that placeholder, sobefore displaying these messages, you must define your own custom format:


The progressbar widget uses the jQuery UI CSS framework to style its look and feel. If progressbar specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option:


Specify additional classes to add to the widget's elements. Any of classes specified in the Theming section can be used as keys to override their value. To learn more about this option, check out the learn article about the classes option.


Note: For options that have objects as their value, you can get the value of a specific key by using dot notation. For example, "foo.bar" would get the value of the bar property on the foo option.


Note: For options that have objects as their value, you can set the value of just one property by using dot notation for optionName. For example, "foo.bar" would update only the bar property of the foo option.


I have a basic progress bar example here straight from the Maya help file. I'm having a problem though if I press Esc before I run the script the -isCancelled state is set to true which makes no sense, since the progress bar doesn't exist yet. What am I doing wrong here, because if I run this script once and let it finish everything is fine, but if I then press Esc before running it and run it again it thinks I tried to escape it in the middle of the loop which makes no sense. This seems totally broken?


@Kahylanyes correct, the progress bar does not show up as if you immediately pressed escape. I've tested this thoroughly and it always happens. If I run the progress bar and press escape while the bar is in progress everything is fine, if I let the bar finish everything is fine. But if I let the bar finish and then press escape, the next time I execute the script it immediately quits and I need to run the script a second time to clear out the buffered escape press. I'm using Maya 2022.3


To see if the the printstatement gets executed on when the progressbar doesn't show up which would mean that -isCancelled doesn't reset for some reason or if it doesn't print which would mean the programm itself isn't running at all...


@Kahylanthanks for the test script, if I run it and press escape during the progress bar being visible everything is fine, but if I press escape before running the script it does not show the progress bar and does not print RUNNING and I have the run the script a second time before it works again. I've tried querying the isCancelled value and it's always 0 even when the script will fail to execute on the next run.


Hmm. It's strange... So the printstatement tells us that for some reason the script isn't running from the top but you are righ the Result means that Maya did something. And I'm sorry but I have no clue why this is happening.


There is a last thing that I think would be worth trying out. Which is pack the script into a procedure and then calling the procedure at the end of the script, which is generally seen as a cleaner way of running stand alone scripts like this. I'm not sure if this will help, but it's worth a shot.


@Kahylanso putting it in the procedure does change the result, but doesn't fix the problem. In the procedure if you press escape before running it the script skips to the end and prints RUNNING, but nothing else happens and there is no progress bar. Very mysterious.


So as a workaround you can use progressWindow instead, this isn't as nice looking, but it does not contain the bug and you can cancel the progressWindow with the Esc key and everything works correctly. Here's how to get it working.


I'm working on the version 10 platform and enjoying it highly, but now stumbled upon a small problem. I have a screen in my mobile app where I synchronize some data, i like to show the progression to the user using a progress bar, but from code there is no way I can change the value of the progresssbar. Anuone has an idea hw to accomplish this ?


First you have to create a local variable on your screen to store the progress. Then you have increment that variable's value as the progress of sync moves forward (on that assign). The trick here is to update the UI while this logic is running. To do that you will have to use a Javascript node with the following code:


But be careful and don't execute this JS Node very often as it will have significant performance impact and slow down the whole operation. I suggest that you do this once in a while (for instance for every 30 iterations or more - you'll have to tweak this).

3a8082e126
Reply all
Reply to author
Forward
0 new messages