Re: Enable Unique Selection

2013-05-04 Thread Andy Lee
On May 4, 2013, at 12:54 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Seems to me rather less code. Well sure, if you want to write *less* code. :) (To add to the duh factor, I know I wrote other value transformers on that project.) --Andy

Re: Enable Unique Selection

2013-05-03 Thread Andy Lee
On May 3, 2013, at 1:29 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a button which only makes sense when exactly one thing is selected. Currently it's Enabled property is bound to Array Controller.selectedObjects.@count. I.e. the button is enabled if one or more things are

Re: Enable Unique Selection

2013-05-03 Thread Gerriet M. Denkmann
On 3 May 2013, at 17:07, Andy Lee ag...@mac.com wrote: On May 3, 2013, at 1:29 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a button which only makes sense when exactly one thing is selected. Currently it's Enabled property is bound to Array Controller.selectedObjects.@count.

Re: Enable Unique Selection

2013-05-03 Thread Steven Degutis
Personally I would just use the value transformer approach. It's easy, obvious, and discoverable. Any other solution I can think up with would be lacking in at least one of these. I actually find value transformers to be super helpful when working with bindings. I've used one for an empty string

Enable Unique Selection

2013-05-02 Thread Gerriet M. Denkmann
I have a button which only makes sense when exactly one thing is selected. Currently it's Enabled property is bound to Array Controller.selectedObjects.@count. I.e. the button is enabled if one or more things are selected. But I want it to be disabled when nothing is selected AND also if more