Hello I'm new to EJS and I run a Mac with OS 10.8.2 and Java SE 6. I find a weird behavior when I try to change the numerical value of some data on a text field. Namely the background changes to yellow, but the numerical change does not affect the dynamics at all. First I thought this was due to my little expertise, however I keep observing this behaviour in other simulations that come with the installation. For example, take the one called /ModellinfScience/Ch04_Drawing/BatonThrow.xml The simulation responds to the slider action, but changing the value of w on the text field has no effect (beyond changing the wintow to yellow). This happens to me with any .jar simulation edited with EJS (even others I downloaded from the web). It does not happen however with other simulations, like for example the ones in http://phet.colorado.edu/en/simulations/category/physics
I think the simulation is behaving correctly. The yellow background indicates that the field has been edited but not yet entered into the model. You must press ENTER to transfer the new value from the user interface (the field) to the model.
PS: Did you know that you can enter simple math expressions, such as 2*pi, into a numeric input field?
Re: Re: Re: Re: changing value on text field has no effect -
Wolfgang
192 Posts
We do it this way so that we can parse arithmetic expressions and so that you can edit a parameter while a simulation is running. Otherwise, whenever you type something, that value would go to the model although the next character would change the meaning of what you are typing. If you type 2*p you will get an error but not when you finish the expression 2*pi.