# Module vs. DynamicModule wrt ProgressIndicator

Why does the following work for Module but not DynamicModule?

Module[{test},
test = 0;
Column[{Button["Calc",
test = 0.1; Pause[1.0];
test = 0.25; Pause[1.0];
test = 0.5; Pause[1.0];
test = 0.75; Pause[1.0];
test = 0.9; Pause[1.0];
test = 1.0, Method -> "Queued"],
Row[{"Progress: ", ProgressIndicator[Dynamic[test]]}]}]]


DynamicModule[{test},
test = 0;
Column[{Button["Calc",
test = 0.1; Pause[1.0];
test = 0.25; Pause[1.0];
test = 0.5; Pause[1.0];
test = 0.75; Pause[1.0];
test = 0.9; Pause[1.0];
test = 1.0, Method -> "Queued"],
Row[{"Progress: ", ProgressIndicator[Dynamic[test]]}]}]]


If I have other reasons to need the module to be a DynamicModule, how can I get this functionality to work?

• Because of the most annoying bug in UI: 100828, your example is even worse to find a fix for.
– Kuba
Sep 11, 2019 at 18:43
• In this case Refresh works.
– chuy
Sep 11, 2019 at 18:48
• Wow. Yes, that is an annoying bug, @Kuba! And thank you @chuy, that does indeed work beautifully. Sep 11, 2019 at 18:58

Thanks to @chuy, we have a solution:

DynamicModule[{test},
test = 0;
Column[{Button["Calc",
test = 0.1; Pause[1.0];
test = 0.25; Pause[1.0];
test = 0.5; Pause[1.0];
test = 0.75; Pause[1.0];
test = 0.9; Pause[1.0];
test = 1.0, Method -> "Queued"],
Row[{"Progress: ",
ProgressIndicator[Dynamic[Refresh[test]]]}]}]]

• I don't think you need the TrackedSymbols option.
– chuy
Sep 11, 2019 at 19:08
• Ah, thank you! This is my first time to use Refresh, so I didn't even think to leave it out. I'll fix the answer. Sep 11, 2019 at 19:21