I am in the middle of making a CDF for a collection of expensive calcuations and plots. I've gone with DynamicModule and have read the documentation but I've obviously missed a few things as it is not working as expected. The code below demonstrates my problem but the actual code of calcuations and plots is much, much larger.
then those controls show as the text of the commands that make them. Then executing the module a second time the controls show as the are supposed to. The plots and charts are linked to the update variable and refresh when the Run Simulation button is clicked on both the first evaluation and the second evaluation.
The Dynamic@Refresh keeps kicking out a Null. If I end it with a ; then none of the plots and tables update when the Run Simulation button is pressed. This seems odd that making it not display output results in it not running the code inside. Is this a bug?
When previewed as CDF Player I get a ton of errors from the FE' context when I click the Run Simulation button. I have SaveDefinitions -> True on the module so am not certain why this is happening.
When the notebook window is moved the simulation runs repeatedly. Also, when CDF Player is previewed moving the window it is in causes the simulation to repeatedly run. This only happens in the CDF Player preview until the Run Simulation button is pressed. After it is pressed moving the window does not cause the simulation to run. It always runs in the notebook when the window is moved even after pressing the Run Simulation button. It is an expensive simulation so this behaviour is very much not desired.
Notebook is attached with code example that has all four issues.