cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
thickey
Level III

list box widget not working as expected.

Here is a simple snippet which pops up a list box and when an item is selected it should simply return the item to the log window. In reality I have a function which will do something with the returned item. 

 

However, in JMP 15 it always return the item twice which is odd behavior. Maybe this is an unintended use case and I need to use this widget another way.

 

 

myListBox = listBox({"A", "B", "C"}, width(50), maxSelected(1), nlines(3), 
	<< script(
		mySelection = myListBox << getSelected;
		print("I selected: " || mySelection[1]);
	);
);

newWindow("Test", myListBox);

thickey_0-1612832055277.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: list box widget not working as expected.

I am running JMP 15.2.1 and I get only one printing to the log

myListBox = listBox({"A", "B", "C"}, width(50), maxSelected(1), nlines(3), 
	<< script(
		mySelection = myListBox << getSelected;
		print("I selected: " || mySelection[1]);
	);
);

newWindow("Test", myListBox);
/*:

DisplayBox[EvalContextBox]
"I selected: B"
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: list box widget not working as expected.

I am running JMP 15.2.1 and I get only one printing to the log

myListBox = listBox({"A", "B", "C"}, width(50), maxSelected(1), nlines(3), 
	<< script(
		mySelection = myListBox << getSelected;
		print("I selected: " || mySelection[1]);
	);
);

newWindow("Test", myListBox);
/*:

DisplayBox[EvalContextBox]
"I selected: B"
Jim
thickey
Level III

Re: list box widget not working as expected.

Thanks Jim. Interestingly it does not happen on JMP 12. I also tried it on another machine with a separate JMP install (Also JMP 15.0.0) and it does this double print.

 

The issue though is that it seems to run EVERYTHING which is part of a <<script() in this widget twice. 

 

I'll see if I can update my JMP to > 15.0.0

thickey
Level III

Re: list box widget not working as expected.

Upgraded to JMP 15.1 and the issue is resolved. 

 

Thanks Jim.

Jeff_Perkinson
Community Manager Community Manager

Re: list box widget not working as expected.

I'm glad to hear that @thickey. I can confirm that this was a bug introduced in JMP 15.0 and fixed in JMP 15.1.

 

But remember that 15.1 isn't the most recent release of JMP 15. You can get JMP 15.2.1 at jmp.com/update

-Jeff