Choose Language Hide Translation Bar
Highlighted
yanee
Level III

How to make Col List Box Report only specific data type

try to make a column list box so the user can select parameters for analysis. 

Want to limit to column with data type "character" in this col list box.  Use the script below but it report all columns.

 

nw = new window("Select Parameter for Pareto",
borderbox(left(3),top (2),
		hlist box(
			textBox("Select Group for Yield Analaysis"),
			hlistbox(
				vlistbox(
						panelbox("Select group",
						ColListData = collistbox( all, << set Data Type( "character" ));
						)
				)
			),
			panelbox("Select Parameters",
				LineupBox(NCol(2),Spacing(3),
                        ButtonBox("Y, Columns", colListY<<Append(colListData<<GetSelected)),
                        colListY = ColListBox(nLines(5),"character"),
			),
		 
			),
			panelbox("Action",
				button box("OK",
					list = eval(colListY<<getitems);
					nw << close window;
				),
				button box("Cancel",nw<<close window),
				button box ("Remove",
					 colListY<<removeselected;
				)
			)
		

))
);
3 REPLIES 3
Highlighted
txnelson
Super User

Re: How to make Col List Box Report only specific data type

Here are the options available to Col List Box, taken from the Scripting Inded

     Help==>Scripting index

It has options for  setting the data type and the modeling type

collist.PNG

 

Jim
Highlighted
yanee
Level III

Re: How to make Col List Box Report only specific data type

try that but it still show all columns.

Highlighted
txnelson
Super User

Re: How to make Col List Box Report only specific data type

Here is a rework of your code.  You had already limited the first Col List Box() to "Character", you just didn't use the correct syntax for the second Col List Box()

collistbox.PNG

names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

nw = new window("Select Parameter for Pareto",
borderbox(left(3),top (2),
		hlist box(
			textBox("Select Group for Yield Analaysis"),
			hlistbox(
				vlistbox(
						panelbox("Select group",
						ColListData = collistbox( all, << set Data Type( "character" ));
						)
				)
			),
			panelbox("Select Parameters",
				LineupBox(NCol(2),Spacing(3),
                        ButtonBox("Y, Columns", colListY<<Append(colListData<<GetSelected)),
                        colListY = ColListBox(all,nLines(5), << set Data Type( "character" )),
			),
		 
			),
			panelbox("Action",
				button box("OK",
					list = eval(colListY<<getitems);
					nw << close window;
				),
				button box("Cancel",nw<<close window),
				button box ("Remove",
					 colListY<<removeselected;
				)
			)
		

))
);
Jim
Article Labels