Subscribe Bookmark RSS Feed

Combo Box << Get Items bug, need work around

msharp

Super User

Joined:

Jul 28, 2015

I just discovered an inconvenient bug:

Names Default to here(1);

list = {};

for(i=1, i<=10000, i++,

       insert into(list, char(i))

);

New Window("test", cb = combobox(list));

cbitems = cb << Get Items;

nitems(cbitems);

//1000

Yes that's right, Get Items is only returning the first 1000 options in the combo box.  (I'm running JMP 12 Pro on Windows 7)

Is there a way to iterate through all the items in a combo box?

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

What about a hidden ListBox that mirrors the ComboBox?

Names Default to here(1);

list = Repeat( i = 0; {i++; Char( i )}, 1e4 );

NewWindow( "test",

    lb = ListBox( list, <<visibility( collapse ) ),

    cb = ComboBox( lb << get items, lb << set selected( cb << get ) )

);

8 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

I can not see a workaround for your issue.

i tried adding different elements to the msg, which resulted in no change in the results.

I suggest you submit the "bug" to support@jmp.com so it becomes an offically tracked item.

Jim
msharp

Super User

Joined:

Jul 28, 2015

I submitted the case when I wrote this post.  I'm also guessing from your hyphenation of bug that you mean to suggest that this is a feature?

Anyways, any good way to iterate through a Combo Box?  I couldn't find one. 

Another option I figured is to throw the list into a private data table column and track that over the combo box, but I'd prefer not making the system more complex.

Another option still is to use a list box instead of combo box, but that's going to make the GUI too large/ugly.

Solution

What about a hidden ListBox that mirrors the ComboBox?

Names Default to here(1);

list = Repeat( i = 0; {i++; Char( i )}, 1e4 );

NewWindow( "test",

    lb = ListBox( list, <<visibility( collapse ) ),

    cb = ComboBox( lb << get items, lb << set selected( cb << get ) )

);

msharp

Super User

Joined:

Jul 28, 2015

This is a really smooth work around!  Thanks for the suggestion.

Just added a lb << Clear Selection; lb << set selected( cb << get ).

ron_horne

Super User

Joined:

Jun 23, 2011

perhaps the most low tech solution is having a few combo boxes  to allow braking the lists into sub lists of a thousand each. this would only be worth if there are not many thousands of items. it may also make it easier for the user to select a value out of such long lists.

msharp

Super User

Joined:

Jul 28, 2015

I guess this is possible if you include a radio box to determine which combo box has the selection.  It's definitely going to look messy though.

pmroz

Super User

Joined:

Jun 23, 2011

Here's another idea to consider.  I often have long lists of things which are displayed using a listbox.  The user can either select directly from the listbox, or I include a search box which trims down the listbox of items to those that contain the search string.  I can post some sample code if you like.

msharp

Super User

Joined:

Jul 28, 2015

The problem with a list box over combo box isn't necessarily aesthetic as much as it is real estate.  Also, I am using search functions, which is the reason why this all came about.