The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Combobox selection dilemma

I am trying to figure out how to best handle the Combobox state in my application.

Should I:

1) Always have a default selection.
This seems great at first, but slowly gets annoying when you want to select something other than the default selection.

2) Have no selection. Leave it blank.
This avoids the annoying problem above, but now the user doesn't know what to do. There are no instructions!

3) Have no selection, but have the combobox say "Please make a selection".
This is the best way except I don't know how to do it. I could make the first option in the list be "Please make a selection", but I don't want "Please make a selection" to appear in the dropdown menu.

Any idea how I can get #3 to work?
coding_monkey
Sunday, March 25, 2007
 
 
How about 4) provide instructions through a label or tool tip?
AMerrickanGirl
Sunday, March 25, 2007
 
 
How does #2 avoid the problem in #1?
JW
Sunday, March 25, 2007
 
 
> How about 4) provide instructions through a label or
> tool tip?

That's another possibility. I could make it glow, or put a colored rectangular box around it or something...
coding_monkey
Sunday, March 25, 2007
 
 
>  How does #2 avoid the problem in #1?

It is a similar problem, but I personally hate it when the application picks stuff for me. Not even necessarily like MS Word which thinks it knows best, but if any selection has the same weight as any other, then the user should get to pick it from the get go.. That's my personal opinion.
coding_monkey
Sunday, March 25, 2007
 
 
The combobox should show the item that is either currently applicable for the current context or was selected the last time the combobox was used.
Neville Franks Send private email
Sunday, March 25, 2007
 
 
Maybe a combobox isn't the right option in the first place.  If you only have a few options, it's easy to select something from a listbox or list of radio buttons than from a combobox.
Kyralessa Send private email
Sunday, March 25, 2007
 
 
Thank you for your suggestions.

> The combobox should show the item that is either
> currently applicable for the current context or was
> selected the last time the combobox was used.

"Currently applicable for the current context" is not applicable.  :)

The user creates a bunch of records in the application. He can view any one of them. Any one is no more applicable than the other. I know I never told you this before so you couldn't have known.


> Maybe a combobox isn't the right option in the first
> place. If you only have a few options, it's easy to
> select something from a listbox or list of radio
> buttons than from a combobox.

Very possible. These "selections" are not built-in options though. They are records the user creates, so they are dynamic in nature. Radio buttons are definitely not the way to go.
coding_monkey
Sunday, March 25, 2007
 
 
Go back to basics....

Combo box (and radio button set) = List of items where 1 is always selected.

If there is a valid state when no item is selected, then combo box (and radio button set) is the wrong control.


I think you should be using some other control, mostly like a listbox or listctrl, for this function.
S. Tanna
Sunday, March 25, 2007
 
 
"These 'selections' are not built-in options though. They are records the user creates, so they are dynamic in nature. Radio buttons are definitely not the way to go."

Depends on what language you're programming in.  If the user can create a hundred options, radio buttons probably aren't the way to go.  If the user is only likely to create five or six, then (in .NET, at least) it's easy enough to dynamically create radio buttons and attach event handlers.

Though a listbox is still probably better for a dynamic list of options if you don't have a fixed upper limit on the number of items.
Kyralessa Send private email
Sunday, March 25, 2007
 
 
As for the question on how to make #3 work, you'll need to remove the 'teaser' entry either at the moment the user starts making a selection (#3.a) or right after he made the first selection (#3.b).
We usually go for #3.b, since it can be distracting if you open the dropdown and immediately end up on a selection with  no option to 'cancel' (what if the user just wanted to check the available options but does not want to make a selection yet?). So on first opening, the 'teaser' entry stays in the list, indicating a 'no selection' state. If something else gets selected, the 'teaser' gets removed (only 'valid' selections left in the list).
HeO Send private email
Monday, March 26, 2007
 
 
Make the default selection be the first record of whatever sort order you’re using, so it starts at “the beginning.” I think you’re a small minority. I’ve never witnessed a user being offended by a app making a default selection in a situation like this. Even if the default is only right 10% of the time (an average of 10 records in your case) that’s a 10% cut in user work. This applies whether you’re using a combo box or list box (the latter which I agree is preferred if you have the space). This also applies whether the control is in a dedicated dialog box for selecting a record or on the same page/window that displays the record (the latter is a good design if users frequently switch among records).

However, if the user navigates to the chosen record from a home page or dashboard, then your Option 3 is probably best, specifically if there’s no space for a list box or list of links for the records and the average number of records is greater than 2. Use a _pulldown menu_ rather than a combo box to avoid the prompt appearing as an option, and also to eliminate the clutter of a “Go” button. The menu prompt/caption should not be “Please make a selection,” but something more specific like “Display Record,” or even just “Records” (or whatever your users call these things they’ve created).
Michael Zuschlag Send private email
Monday, March 26, 2007
 
 
I've done your option 3 in C++. The key is to make it an owner drawn control. You can detect when it is trying to display a negative itemID, and substitute your own prompt string.

It seems like this capability would be built into Windows itself, especially since the browser seems able to do it, but I couldn't find it. It was a lot more trouble than it was worth for such a simple function.
Mark Ransom Send private email
Monday, March 26, 2007
 
 
I think it works if you have the text (as visible at design time) be "Please select preferred beer". The actual entries are added as usual:

cbBeer.Items.Add("Sam Adams Boston Lager") ;

After the user changes the control, he can't get the original text back.

I have a lot of trouble with the VS controls, expecially listboxes because changing the visible text does not necessarily change the selected text.
Peter Vanderwaart
Tuesday, March 27, 2007
 
 
Your #3 is addressed by Microsoft in Windows Vista, see http://msdn2.microsoft.com/en-us/library/aa511458.aspx#prompts.

Implementation of such behavior for older versions of ComboBox depends on your technology. I have made it work even for HTML page in the browser. The idea is to overlap the Combo box with a static label (formatted to show gray italic text). I hide the label when it is clicked, and restore it if no selection was made.
Alex Cohn Send private email
Thursday, March 29, 2007
 
 
Alex, thanks for that info. A little Googling turned up more details:

http://msdn2.microsoft.com/en-us/library/ms673114.aspx#cue_banner
http://msdn2.microsoft.com/en-us/library/aa361894.aspx

I wonder how many other new features have been added to the classic Windows API in Vista?

I like your idea of overlaying a static control over the combo box too, it sounds a lot easier than my method of owner drawing. Just one question, do you change the appearance of the static control when the combo box gets the keyboard focus? Someday I'll have to get access to a Vista machine to see how theirs behaves.
Mark Ransom Send private email
Thursday, March 29, 2007
 
 
Mark,

I'd simply hide the label while the combo has focus or is not empty. In Vista, the explorer shows a search box which behaves as follows: when it gets focus via mouse click or any other means, the gray italic "Search..." disappears.
Alex Cohn Send private email
Sunday, April 01, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz