Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
bumimeku
Level I

tablebox question

Hi

 

I want to make a tablebox that one of it column each cell can have a value of "Yes" or "No"

thought of using a combobox for it

try using the following code with no success

 

New Window( "Bla Bla",
	tb = Table Box( c1 = String Col Box( "Bla Bla", {cb = Combo Box( {"Yes", "No"} ) << get selected} ) )
)

 

any idea?

 

 

 

Homemade Gay Tube Porn
https://homemadegaytubeporn.com/en/
2 REPLIES 2
Highlighted
pmroz
Super User

Re: tablebox question

You can achieve this using col boxes.  Mentioned in the presentation by myself and @Justin.chilton.

 

Here's some sample code that shows a variety of things you can do with col boxes.

// Col Box Examples
nw = New Window( "Mountains",
	tb = Table Box(
		sb = String Col Box( "Mountain",
			{"K2", "Delphi", "Kilimanjaro", "Grand Teton"}),
// Text boxes of different colors
		cc = col box("PT Name", 
			tb1 = textbox("Hello"),
			tb2 = textbox("World"),
			tb3 = textbox("Fubar"),
			tb4 = textbox("Geronimo")),
		nb = Number Col Box( "Elevation (meters)",
			{8611, 681, 5895, 4199}),
// Checkboxes, no header
		cb1 = checkbox({"", "", "", ""}),
// Checkboxes, with a header
		cb2 = col box("Yes/No?",
			cba = checkbox(""),
			cbb = checkbox(""),
			cbc = checkbox(""),
			cbd = checkbox("")),

// Comboboxes
		cb2 = col box("Response?",
			cmb1 = combobox({"Yes", "No"}),
			cmb2 = combobox({"Yes", "No"}),
			cmb3 = combobox({"Yes", "No"}),
			cmb4 = combobox({"Yes", "No"})),

// Button boxes
		bb = col box("Comment",
			bb1 = buttonbox("", print("First Button Action")),
			bb2 = buttonbox("", print("Second Button Action")),
			bb3 = buttonbox("", print("Third Button Action")),
			bb4 = buttonbox("", print("Fourth Button Action")),
		),
	),
	panelbox("Actions",
		hlistbox(
			button box("Cancel", nw << close window),
			button box("OK", 
				yn1 = cb1 << get(1); yn2 = cb1 << get(2);
				yn3 = cb1 << get(3); yn4 = cb1 << get(4);
				yna = cba << get(1); ynb = cbb << get(1);
				ync = cbc << get(1); ynd = cbd << get(1);
				print(char(yn1) || char(yn2) || char(yn3) || char(yn4));
				print(char(yna) || char(ynb) || char(ync) || char(ynd));
				nw << close window;
			),
		),
	),
);
tb << set underline headings(1) << set column borders(1) << Set Shade Alternate Rows(1);

nb << Set Conditional Format("Alert Rule");

// Set color and style of text boxes
tb1 << font color("Red") << set font style("Bold");
tb2 << font color("Blue");
tb3 << font color("Green");
tb4 << font color("Orange") << set font style("Bold");

// Set icon for button boxes
bb1 << set icon("SASLog");
bb2 << set icon("SASLog");
bb3 << set icon("SASLog");
bb4 << set icon("SASLog");

colboxexamples.png

 

Highlighted
txnelson
Super User

Re: tablebox question

You need to use a Col Box() function to do what you want.  Check it out in the Scripting Index.  Below is a ruff example of what you want to do:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

New Window( "test",
	Table Box(
		String Col Box( "name", dt:name << get values ),
		Col Box(
			"Select",
			Cb1 = Combo Box( {"Yes", "No"}, cb1 << get selected ),
			Cb2 = Combo Box( {"Yes", "No"}, cb2 << get selected ),
			Cb3 = Combo Box( {"Yes", "No"}, cb3 << get selected ),
			Cb4 = Combo Box( {"Yes", "No"}, cb4 << get selected ),
			Cb5 = Combo Box( {"Yes", "No"}, cb5 << get selected ),
			Cb6 = Combo Box( {"Yes", "No"}, cb6 << get selected ),
			Cb7 = Combo Box( {"Yes", "No"}, cb7 << get selected ),
			Cb8 = Combo Box( {"Yes", "No"}, cb8 << get selected ),
			Cb9 = Combo Box( {"Yes", "No"}, cb9 << get selected ),
			Cb10 = Combo Box( {"Yes", "No"}, cb10 << get selected ),
			Cb11 = Combo Box( {"Yes", "No"}, cb11 << get selected ),
			Cb12 = Combo Box( {"Yes", "No"}, cb12 << get selected ),
			Cb13 = Combo Box( {"Yes", "No"}, cb13 << get selected ),
			Cb14 = Combo Box( {"Yes", "No"}, cb14 << get selected ),
			Cb15 = Combo Box( {"Yes", "No"}, cb15 << get selected ),
			Cb16 = Combo Box( {"Yes", "No"}, cb16 << get selected ),
			Cb17 = Combo Box( {"Yes", "No"}, cb17 << get selected ),
			Cb18 = Combo Box( {"Yes", "No"}, cb18 << get selected ),
			Cb19 = Combo Box( {"Yes", "No"}, cb19 << get selected ),
			Cb20 = Combo Box( {"Yes", "No"}, cb20 << get selected ),
			Cb21 = Combo Box( {"Yes", "No"}, cb21 << get selected ),
			Cb22 = Combo Box( {"Yes", "No"}, cb22 << get selected ),
			Cb23 = Combo Box( {"Yes", "No"}, cb23 << get selected ),
			Cb24 = Combo Box( {"Yes", "No"}, cb24 << get selected ),
			Cb25 = Combo Box( {"Yes", "No"}, cb25 << get selected ),
			Cb26 = Combo Box( {"Yes", "No"}, cb26 << get selected ),
			Cb27 = Combo Box( {"Yes", "No"}, cb27 << get selected ),
			Cb28 = Combo Box( {"Yes", "No"}, cb28 << get selected ),
			Cb29 = Combo Box( {"Yes", "No"}, cb29 << get selected ),
			Cb30 = Combo Box( {"Yes", "No"}, cb30 << get selected ),
			Cb31 = Combo Box( {"Yes", "No"}, cb31 << get selected ),
			Cb32 = Combo Box( {"Yes", "No"}, cb32 << get selected ),
			Cb33 = Combo Box( {"Yes", "No"}, cb33 << get selected ),
			Cb34 = Combo Box( {"Yes", "No"}, cb34 << get selected ),
			Cb35 = Combo Box( {"Yes", "No"}, cb35 << get selected ),
			Cb36 = Combo Box( {"Yes", "No"}, cb36 << get selected ),
			Cb37 = Combo Box( {"Yes", "No"}, cb37 << get selected ),
			Cb38 = Combo Box( {"Yes", "No"}, cb38 << get selected ),
			Cb39 = Combo Box( {"Yes", "No"}, cb39 << get selected ),
			Cb40 = Combo Box( {"Yes", "No"}, cb40 << get selected )
		)
	)
);
Jim
Article Labels