Hi Mark, Thanks for looking into various approaches. What are the scenarios that make having an API that requires searching the dataprovider, better than an array that parallels the dataprovider, better than requiring a field on the dataprovider like we do for mx:Menu [1] (see "enabled" property).
I honestly don't have an opinion, I just wanted to point out a third possibility that has been done before. Also, instead of providing more than one way, it might be best to settle one one. One disadvantage to providing multiple was of doing something is that you then have to implement and order of precedence (If I use both APIs, which one overrides the other). Couple of other things to consider (and again, I don't have an opinion here either): 1) in the MX days, we "disallowed" duplicate entries in the dataprovider. In Spark, we do not, so there is a theoretical chance that a label can be in there twice (practically, I can't really think of why anybody would do that) so you have to decide whether to cover such a case or not. 2) In a buttonbar of just icons (audio/video playback controls or something like that) can you assume there are distinct labels to search for? [1] http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/mx/contr ols/Menu.html On 4/27/13 5:19 AM, "Mark Kessler" <kesslerconsult...@gmail.com> wrote: > Well I definitely want to keep the single ones, but I can add an array > based ones too. I'll put together an a new base method and then add the > two array based enable/disable methods later on tonight. We can go over > the array ones then. > > > > On Sat, Apr 27, 2013 at 3:29 AM, RIAstar <max...@riastar.net> wrote: > >> Hi Mark, >> >> Interesting idea. I was thinking: wouldn't it be more convenient to let >> all that happen through one property of type Array? >> Lets' call it `disabledButtons:Array`; it would disable the items in the >> Array en enable those not in the Array. >> >> That way this code from your test app >> >> if (dgTestData.isFirstRow == true) >> { >> bbTest.buttonDisable("First"); >> bbTest.buttonDisable("**Previous"); >> } >> else >> { >> bbTest.buttonEnable("First"); >> bbTest.buttonEnable("Previous"**); >> } >> >> would become >> >> if (dgTestData.isFirstRow == true) >> bbTest.disabledButtons = ["First", "Previous"]; >> >> and as another plus, you could use binding on that property through MXML. >> Something like: >> >> <s:ButtonBar disabledButtons="{**disabledButtonsArray}"/> >> >> What do you think? >> Max >> -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui