NSComboBoxCell menu selection in an NSTableColumn
NSComboBoxCell menu selection in an NSTableColumn
- Subject: NSComboBoxCell menu selection in an NSTableColumn
- From: Carl Harris <email@hidden>
- Date: Wed, 31 Mar 2010 13:21:05 -0400
My application has an NSTableView with a column whose cell is an NSComboBoxCell. Just to keep things simple (for the purpose of explanation here), let's assume that the combo box cell is configured with a list of items via the IB Inspector. The table view is nothing special -- just the standard NSTableView. The table column value is simply bound to arrangedObjects.somePropertyName on an NSArrayController that holds the objects in the table.
Suppose the user adds a row to the table, begins editing the row, and tabs over to the combo box column. Without typing any text into the cell, the user presses the down arrow key on the keyboard. As expected, the combo box's menu opens and the up/down arrow keys can be used to change the selected item. If the user selects an item from the menu and presses Return, the combo box menu disappears, but the selected item *is not* set as the value of the table column.
On the other hand, suppose that the user adds a row to the table, begins editing, tabs over to the combo box column, and types some text into the cell first, then hits the down arrow key on the keyboard. Once again the combo box's menu appears, as expected. However, when the user selects an item from the menu and hits Return, the selected item *is* set as the value of the table column.
Can someone explain this behavior to me?
Using the mouse to open the combo box menu and select an item works as expected -- the selected item is set as the value of the table column.
Using an NSComboBox control outside of a table column, the keyboard navigation of the combo box's menu works as expected -- whether or not the user has entered some text into the text field, if the menu is opened (using down arrow on the keyboard) and an item is selected followed by Return, the selected item is set as the value of the field.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden