cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
afterword
Level IV

Setting Initial Value in Modal Combo Box

I'm trying to request start and end dates from the user through a modal dialogue using the combo box. I'd like 2009 to be selected in the year field by default, but I can't figure out how to accomplish this with the following year list:
years = {"2006", "2007", "2008", "2009"};

When I use
startYear = comboBox(years, <the script is ignored, though this format is interpreted properly in the non-modal framework.

Any ideas for setting a default in the modal dialogue?
2 REPLIES 2
SDF1
Super User

Re: Setting Initial Value in Modal Combo Box

Hi @afterword ,

 

  I came across this post searching for something similar. If you haven't yet found a solution, try using the <<Set() command where you'd enter the item number for the combo box. In your case, you'd enter 4 because this corresponds to "2009".

 

Hope this helps,

DS

txnelson
Super User

Re: Setting Initial Value in Modal Combo Box

Try this

Names Default To Here( 1 );
years = {"2006", "2007", "2008", "2009"};

New Window( "test",
	modal,
	startYear = Combo Box( years,x=years[startyear<<get] ),
	startYear << set( 3 )
);

After exiting the window, the variable "x" will contain the selected year.

Jim

Recommended Articles