InputField[Dynamic[rr, {(dd = #) & }]]
You can't do the above. The symbol to the left of =
has to the dynamic symbol in the first argument to dynamics which is rr
.
When using the second argument of dynamics, you are overriding the default behavior of Dynamics, which is to assign to rr
(the thing in the first argument) the current slider value as it is being changed. Therefore, you have now to do this yourself, by writing rr=#&
, else rr
will never get updated. You are now in control of Dynamics. Since you did not update rr
in the second argument, it never got assigned to the input.
The second argument of dynamics can be single pure function (as in this example), or it can be a list of two pure functions. In this case, the first function is used during interaction, and the second is evaluated at end of interaction.
Or it can be a list of 3 pure functions, in this case, the first function is evaluated at start of interaction, and the second is evaluated during interaction, and the third is evaluated at end of the interaction (when you release the mouse). This way, you can have complete control of Dynamics at each phase.