NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 23, 2017, 09:35:40 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Brevity is the Soul of wit. ..."Shakespeare (154-1616, English dramatist and poet) "
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Selecting an item (not the first one) in a combobox  (Read 6419 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Edward
Newbie
*
Offline Offline

Posts: 4

«
Embed this message
on: February 28, 2008, 10:50:06 pm » posted from:Hengelo,Overijssel,Netherlands

I want to select an item in a combobox (not the first one). How can I manage this?
See the attached demo program.


*** There are 1 more attached files. You need to login to acces it!
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: February 29, 2008, 09:10:31 am » posted from:Taipei,T\'ai-pei,Taiwan

If you have set the options as "1;2;3", you should be able to select it in the editor window.
Because you set up the options in the _initialize panel, so the options only get it's value at run time.
That is the reason why you was not able to select it in the editor window.
However, If you "run" it, you or any user should be able to select an item from it.

I disable your initialization page, and modified the "test_str_all" variable.
Please see the attached file, you should be able to select it (set default value) now.


*** There are 1 more attached files. You need to login to acces it!
Logged
Edward
Newbie
*
Offline Offline

Posts: 4

«
Embed this message
Reply #2 on: March 03, 2008, 04:57:45 pm » posted from:Hengelo,Overijssel,Netherlands

I wasn't completely content with the solution mentioned. The strings for the variables in my real program are rather big and I want to use the same variable for more comboboxes. So I tried more and I discovered that selecting an item didn't work when the string begins with a space character:
- when using the string test_str_all = " 1; 2; 3; 4", I couldn't selecting an item at the initialize tab.
- when I use the string test_str_all = " 1;2;3;4", I can select an item at the initialize tab.
See also the xml file.


*** There are 1 more attached files. You need to login to acces it!
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: March 04, 2008, 08:58:17 pm »

I could not find a better solution. So I already wrote to the original author of EJS (Profesor Francisco Esquembre) and ask him to response.
If you are interested in EJS. Please visit EJSWiki Page at  http://fem.um.es/EjsWiki/
You will find up-to-date information from there.
Logged
Pages: [1]   Go Up
  Print  
Brevity is the Soul of wit. ..."Shakespeare (154-1616, English dramatist and poet) "
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.049 seconds with 21 queries.since 2011/06/15