APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

error in text field? or is it jus me... post and replies

Return to the error in text field? or is it jus me... thread
Login to post to this thread

changing value on text field has no effect
Javier Mas
5 Posts

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


Replies to changing value on text field has no effect

Re: changing value on text field has no effect -
Wolfgang
192 Posts

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?

Post edited October 8, 2012 at 2:27 PM EST.



Re: Re: changing value on text field has no effect -
Wolfgang
192 Posts

The word ENTER was deleted from the last post because it was inside brackets.  The sentence should read "you must press ENTER"



Re: Re: Re: changing value on text field has no effect -
Javier Mas
5 Posts

OK, thanks a lot. It is not how it works in other applets, but anyhow it sounds sensible.
Javier



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.



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book