When I shorten the sections so I can get the input (slider bar) and out put on the page, Dynamic no longer works. Dynamic only works if you keep all the sections open. Is this a bug or is this supposed to happen?
-
2It's supposed to, Dynamic is only taken care of if it is visible. – Kuba May 27 '16 at 10:55
2 Answers
I thought this info is somewhere on top of tutorials or a Dynamic documentation, it isn't so let me add this answer:
tutorial / AdvancedDynamicFunctionality / Automatic Updates of Dynamic Objects
[...]
Dynamicoutputs are only updated when they are visible on screen.[...]
Outputs that are scrolled off-screen, above or below the current document position, will be left unexamined until the next time they are scrolled on-screen, at which point they are updated before being displayed.
(Thus the fact that they stopped updating is not normally apparent, unless they have side effects, which is discouraged in general.)
The last sentence means that it is discouraged to do something like
Dynamic[calculations and result]
You should design your GUI such way that you only have Dynamic[result] while calculations are triggered by something stable, like events in EventHandler, Buttons or other controllers. Or even NotebookDynamicExpressions.
Try to shorten the input only by double-clicking on the output, NOT input, "cell designator" or whatever those lines on the right are called. Make sure you double-click on the leftmost one, i.e. the output cell designator. I think, this way, your Dynamic stays active.
- 197
- 7
-
I see, let me see if I can figure out how to keep it activated. I think they might have an option for it. – Milad P. May 31 '16 at 01:15