In Mathematica, InputFields and Sliders that are connected to Dynamics will change their values if the variable they control is changed procedurally. In Wolfram Cloud, only the first dynamic in a notebook seems to behave this way. In this example,
Grid@{{"a =", InputField[Dynamic[a], Number],
Slider[Dynamic[a], {0, 1}]}, {"b =",
InputField[Dynamic[b], Number], Slider[Dynamic[b], {0, 1}]}}
a = 0.25;
b = 0.75;
Print["a = ", a, " b = ", b];
The Input fields and Sliders interact properly. But if I then execute this:
a = 0.75;
b = 0.25;
Print["a = ", a, " b = ", b];
The InputField and Slider associated with variable a update to the new value, but the ones for b do not.
Is there something I’m doing wrong? I’m trying to set up a user interface that consists of InputFields that can be changed interactively, but that can also be set to a number of known value sets procedurally. It works as desired in Mathematica.