Re: Enabled Binding on Controls
Re: Enabled Binding on Controls
- Subject: Re: Enabled Binding on Controls
- From: Michael Jurewitz <email@hidden>
- Date: Mon, 12 Feb 2007 17:08:39 -0800
On Feb 10, 2007, at 12:34 PM, Seth Willits wrote:
If I set a text field's enabled binding such that it's only enabled
when an array controller's selection is not nil, why does that only
work if there's also a value binding? If I only have the enabled
binding, the text field is always enabled regardless. If I add a
value binding, then it enables/disables correctly.
Hi Seth,
As one of my colleagues just pointed out to me, you can probably get
the behavior you want by binding the enabled binding to the array
controller's canRemove key. You can only remove if you have a
selection and it will even supply a BOOL for you without requiring a
value transformer. I did some quick testing with this and it seems
to work just fine.
Also, if you also provide a value binding, you probably want to
uncheck 'Conditionally Sets Enabled'. This can sometimes play a bit
of tug-of-war with the enabled binding (and similarly with the
editable binding and Conditionally Sets Editable).
-Michael Jurewitz
/*****************************************
Apple DTS Engineer
Cocoa - Core Data - Bindings
Save the Date.
WWDC 2007 | June 11-15, San Francisco
http://developer.apple.com/wwdc
email@hidden
*****************************************/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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