Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Editing Multiple Values in a Master/Detail Interface

Editing Multiple Values in a Master/Detail Interface
Thread Tools
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 27, 2005, 01:09 AM
 
I have a table bound to an NSArrayController. I have a window which allows editing of selected items in that table. In this window, there are textfields bound to the selection for each of the columns in the table. When multiple rows are selected in the table, I can enter text into the corresponding textfield and change the value for multiple selected rows. The classic master/detail interface.

Heres the rub. If the values are different in the rows, I have it set to display "Multiple Values Selected" as a placeholder. If I put my cursor in the textfield and the tab out or otherwise shift focus, all entries in the tableview bound to that textfield are clobbered to nil. I mean I havent typed anything. I simply clicked in the textfield or tabbed into it. I want it such that editing only occurs if I actually edit something. Im sure others must have run accross this issue and It must be something I havent set somewhere. How do you all get around this? Do I have to make my own field editor that doesnt send its action unless its stringValue has changed? That sounds great as I type it, but as far as actually implementing it, id be lost...
3R1C
     
GeeYouEye
Junior Member
Join Date: Mar 2003
Location: Walnut Creek, CA
Status: Offline
Reply With Quote
Nov 28, 2005, 03:15 PM
 
I'm not entirely sure which method to override in a subclass (and, in fact, I'm not sure whether you'd have to subclass NSTextField or NSTextFieldCell), but the principle is the same: subclass in IB, create the files, override the method, save, and set the Custom Class for each of the text fields to your new subclass.
I bring order to chaos. You are in chaos windows, you are the contradiction, a bug wishing to be an OS.
     
3R1C  (op)
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 28, 2005, 06:32 PM
 
You wouldn't subclass either. You'd have to subclass the Field Editor that the NSTextField cell uses. That much I know. How to implement that field editor is where Im lost.
3R1C
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:07 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,