Combobox and Restrict Entry

Well, the combobox lets users tab into it on all platforms. Unless the Mac user has Accessibility turned on they won’t be able to tab into the control. So major difference there.

Somewhere floating around in the internet is a project that took a TextField and turned it into an autocomplete field, sort of like the way the code editor works. If there is a match the … shows up in gray and if the user presses tab a popup list is shown and they can select what they want. I don’t remember if it kept non-list members out or not.

I wish I could remember who did it but I don’t. Maybe that will jog the memory of others.

It is not terribly difficult to do with a Listbox. That is what I described above as “Google way”.

But I never, ever encountered such an autocomplete suggestion system that forbid users to enter something not in the database.

@Bob: Maybe this one: https://forum.xojo.com/17318-autocomplete-textfield-control-open-source-update-v-1-0-2

Yup. I would start with that one. Mike’s done a great job on his controls.

I made a little sample of what I meant: GitHub - Carharttguy/xojo-RestrictedComboBox: A ComboBox where you can only type something that corresponds with the list

[quote=309597:@Tim Parnell]
When a user pops open a PopupMenu they can start typing to select an item.
That is not the point of a ComboBox. Use a PopupMenu.[/quote]

That is true for you, and for me, and other people. But the people I’m targetting with my software are not tech types. They see a textbox: They type. They see a little arrow: They select from a list with a mouse.
They see a textbox and a arrow: We can do both?!?

Plus: You cannot really type something in a popupmenu, you must know what you’re searching. Typing an ‘a’ and 2 seconds later a ‘b’, it will only show you items that start with a ‘b’, not ‘ab’.

[quote=309598:@Tim Parnell]Overall (not directed at anybody in particular)
The point of a ComboBox is to offer a combination of TextField and PopupMenu. It allows you as a developer to provide a list of common examples that could save the user time, but allows them to fill in a value you might not have accounted for. By not allowing them to enter their own value, you’re tossing out the purpose of the control.

For example, you might see a ComboBox on a form for an Operating System field. It could start with Mac and Windows, but would allow a Linux user to type in their system. This is a super simplified example. We of course would know to add Linux to the list, and it may seem trivial to select from 1 of 3 options - but you have other UI issues if your PopupMenu is so long it can’t be navigated.[/quote]

And what if your PopupMenu contains 10.000 items? Scroll, scroll, scroll?
I could create a textfield, and a listbox, and do some listbox hiding etc… Ow wait, that’s what a Combobox is!

You’re right from a developer point of view, not so much in GUI usability IMO.

[quote=309606:@Michel Bujardet]I have to agree that using a combobox that way is, IMHO, perverting entirely the notion.

Just as saying “you can use Textfield, but don’t type anything but a specific list of words”…

Well… It is not my software…[/quote]

So you never use a mask, or a textbox that only accepts numerics? Or you don’t use a filter with a GetOpenFolderItem?
You can open files, but not everything?

Software should steer the user in the right direction as much as it can.

No offense to anybody, I respect the opinion of anyone. But the fact that this topic exists and I found it by Googling the same problem, must mean there are other opions! :slight_smile:

[quote=309681:@Mathias Maes]That is true for you, and for me, and other people. But the people I’m targetting with my software are not tech types. They see a textbox: They type. They see a little arrow: They select from a list with a mouse.
They see a textbox and a arrow: We can do both??[/quote]
Yeah, exactly. They can type if they want to, or select an option. It is meant to offer flexibility on a PopupMenu, not restriction.

PopupMenus are not meant to be so long you have to search. If you take two whole complete seconds to type “ab” there are Accessibility options in System Preferences for you so that you can get “ab”

Then, like I said, you have bigger UI problems. A PopupMenu should not contain 10,000 items.

If you have that many items you need to provide a different setup for searching and selection. Depending on what you’re trying to display this is likely a TextField and a ListBox.

From a usability standpoint, blocking custom entry in a ComboBox is poor UX.

[quote=309681:@Mathias Maes]So you never use a mask, or a textbox that only accepts numerics? Or you don’t use a filter with a GetOpenFolderItem?
You can open files, but not everything?[/quote]
Those are filters for those controls. You are defeating (and missing) the purpose of a ComboBox.

Tim… let the man do what he wishes to do… While it is ok to express your opinion… it is also just as OK for him to ignore it.
You are not being bound by his decisions, or forced to use his custom control.
He asked for information, that information was provided, he did with it what he wished to accomplish…

I realize that he is welcome to ignore me, and if he wants to he can. However, he has made comments back to me; which shows he is not ignoring me, so I make a few more comments back. We’re just explaining ourselves to the other.

[quote=309681:@Mathias Maes]That is true for you, and for me, and other people. But the people I’m targetting with my software are not tech types. They see a textbox: They type. They see a little arrow: They select from a list with a mouse.
They see a textbox and a arrow: We can do both?!?

[quote]
uh yeah that IS the point of a combobox

Sounds to me like what you want is a popup menu (a restricted list) that support type ahead

[quote=309681:@Mathias Maes]So you never use a mask, or a textbox that only accepts numerics? Or you don’t use a filter with a GetOpenFolderItem?
[/quote]

My point is that you use Combobox for the wrong purpose. Now you are free to do whatever you want. Including completely inadequate UI.

If you want the user to enter only presets, use a variation of Popupmenu, or Listbox.

Have you ever taken the time to read the UI design guidelines ? Since this is in the Getting Started thread, maybe you should start by learning how to compose a proper UI.

https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/OSXHIGuidelines/
https://developer.microsoft.com/en-us/windows/apps/design

There are reasons why interfaces are standardized. Just the same way as cars have the break pedal to the left of gaz pedal in countries where we drive on the right hand side of the road. Nnd not the other way around. There is a syntax to controls and user interface.

Masks are for TextFields. Not Combobox. The very reason why a combobox entry field exists is for the user to enter something that is not in the drop down menu.

These rules have existed since the early days of Macintosh and Windows, back in the eighties. There are reasons why the most successful programs adhere to these rules, and probably the reason they are successful has to do with that design.

Like writing music, discipline is key to harmony. I am not writing all that to bash you. I am just saying look out, you’re headed for an accident.

Now, as Dave says, do as you please. After all, we all learn from experience.

Just to muddy things more. Isn’t windows made by Microsoft? :wink:

To be fair though… setting match required to true does not keep the user from typing in an invalid entry. It only shows an error when focus is lost if the entry does not match the list.

I realize I’m a bit late to this party, but…

I wanted to have a control where the user could type, it would autocomplete, or the user could see the available options. Sounded like a combobox. But, I did not want to allow the user to add a new choice at that point (the list of options is maintained elsewhere).

The reason I wanted this is because it’s very efficient to tab and type, and on a Mac one can’t normally tab into a popup menu.

I don’t think users would have a problem with this nor do I think it violates the spirit of the combobox control.

-Bob

Not allowing custom entry violates the spirit of ComboBox.
Use a PopupMenu. If a Mac user wants to tab into it, they’ll have tab-all-controls enabled.
Then with the popup menu open, the user can begin typing to jump to the selection.

I like combo boxes because they filter the list for you on the fly. I’m sorry to disagree but there are some use cases where a popup is no good. In my opinion popup boxes are for 25 items or less. A combo box on the other hand might contain 5,000 items and be narrowed down by typing the first few letters.

An example would be selecting from a list of 5000 customers. Typing ‘Joe’ might resulting in a filtered drop down list of 20 people named Joe. Explain to me how to do this with a popup.

In addition in this case you don’t want to allow the user to add new customers, only select an existing customer.

I have long ago replaced the crude popupmenu and combobox dropdown by ListBoxes. Especially in case of autocomplete.

Didn’t someone create an autocomplete textfield and share it on the forum somewhere?

Yeah, I’m not sure where it is on the forums, but here is the link to the GitHub project.

https://github.com/IntelligentVisibility/AutoCompleteTextField

You will need to modify the code to add autocomplete values from an array if you don’t want to use the text file method that the example project employs.

Note: This is not my project, just sharing the good work of another member.

I’m working on a replacement, but have gotten too busy to finish it. Topic: Interest in Mutil-Column Combobox?

[quote=317179:@Neil Burkholder]In tests I was able to load 1 million records 5 column wide, from a local SQLite file in .75 seconds.
Search and update autocomplete drop down list instantly even with 1 million search results being returned.
With 1 million rows and 5 columns the control will use 80-100mb of RAM. In comparison, a list box with the same amount of data uses about 650mb of RAM.[/quote]