cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
csoon1
Level III

How to Grab Items Inside a List Box and pass them to a simple List

I have a List Box that contains "n" items and I don't have control how many items are there. What I want is to simply grab each item and insert them to a list (for more processing). I thought I could simply pass a message "Select All" but I found out it does not work as how I imagined it to be.

 

Let me know if you have suggestions.

 

I was thinking of looping through each item in the list box and have each item "Set Selected" (so that I can Get Selected afterwards). My problem is that I don't know how to determine the number of items in the List Box. I'm not also sure if this idea works.

 

I appreciate any inputs. Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
vince_faller
Super User (Alumni)

Re: How to Grab Items Inside a List Box and pass them to a simple List

a listbox() or a v/hlistbox()?  

if it's a listbox() you can just listbox << Get Items.  

If it's a vlistbox and you're using Jmp 13 you can do nitems(vlistbox) and loop through them. 

if you're using jmp12- you have to do something like

Names Default to here(1);
new window("Test", 
	vlb = vlistbox(
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
	)
);
l = {};
for(box = vlb<<child, !isempty(box), box = box << Sib, 
	insert into(l, box)
);
Vince Faller - Predictum

View solution in original post

2 REPLIES 2
vince_faller
Super User (Alumni)

Re: How to Grab Items Inside a List Box and pass them to a simple List

a listbox() or a v/hlistbox()?  

if it's a listbox() you can just listbox << Get Items.  

If it's a vlistbox and you're using Jmp 13 you can do nitems(vlistbox) and loop through them. 

if you're using jmp12- you have to do something like

Names Default to here(1);
new window("Test", 
	vlb = vlistbox(
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
		textbox("1"),
	)
);
l = {};
for(box = vlb<<child, !isempty(box), box = box << Sib, 
	insert into(l, box)
);
Vince Faller - Predictum
csoon1
Level III

Re: How to Grab Items Inside a List Box and pass them to a simple List

@vince_faller. Thank you very much for a thorough answer. "Get Items" did the job for me as it was a ListBox and I am using JMP13.