Here is a simple fix for your problem.
DynamicModule[{list = "((5, 6), (9, 0))", s}, Panel[Column[{
InputField[Dynamic[list], String, FieldSize -> {50, 5}],
Dynamic[s = ToExpression[StringReplace[list, {"(" -> "{", ")" -> "}"}]]],
Dynamic[ListPlot[s, PlotStyle -> PointSize[0.05]]]
}]]]
When using Dynamic[expression]
I would suggest thinking of it as a message to the front-end saying: "Hey, rather then just showing expression
, could you keep it updated if something changes?".
You can't just wrap Dynamic around every variable and expect expressions down the line to also be Dynamic. And as I stated in a comment, using operations on a Dynamic
wrapped object won't give you the dynamic result of that operation on the variable.
This of course seems to clash with every built-in function that accepts dynamic arguments, for instance Slider[Dynamic[a]]
. Since that returns a dynamic slider, you wold think that your function f[a_,b_]:=a+b
would return a dynamicly updated value if you just ran: f[Dynamic[v1], Dynamic[v2]]
. What instead happens is that the dynamic wrappers prevent evaluation of the sum. The imporant point to remember here is that functions like Slider
work because they expect a dynamic input, and can rewrap the dynamic around their controlls so it still ends up in the right place. For this example, you would have needed to express how f
should handle a dynamic, and could have used: f[Dynamic[a_], Dynamic[b_]] := Dynamic[a + b]
, which would then work in the way expected above.
ToString[]
andToExpression
(insideListPlot
). This works :DynamicModule[{list = "((5, 6), (9, 0))", s}, Panel[Column[{Labeled[ InputField[Dynamic[list], String, FieldSize -> {50, 5}], StringForm["Data Points"], Left], s = ToExpression[StringReplace[list, {"(" -> "{", ")" -> "}"}]], StringQ[s], s, ListPlot[s, PlotStyle -> PointSize[0.05]]}]]]
/ $\endgroup$Dynamic
is a wrapper that the front end handles, so you can't just act like it's the same as the variable. Doing anything likeDynamic[{1,2,3}][[1]]
orSin[Dynamic[x]]
will not work. What you should do is to keep the wrapper on the outer level, and put your operations inside, e.g:Dynamic[{1,2,3}[[1]]]
andDynamic[Sin[x]]
. $\endgroup$