The enabling/disabling of buttons usually doesn't cause a size change so
handling it in measure() is unusual.  Plus, measure() will not be called
if the Button's size is set explicitly.

The enabling/disabling should cause a state change in the skin so reacting
to the stateChange event may be your best bet.

-Alex

On 10/14/13 12:49 PM, "Maurice Amsellem" <[email protected]>
wrote:

>> > I have some custom logic in the first/middle/last button-skin that I
>> > want to execute to disable some buttons. I currently have it inside
>> >
>> > override protected function measure():void { ... }
>
>The techniques suggested by the two Marks should have worked.
>So maybe there is an error in your custom code.
>Can you share part of this code, maybe that would help us.
>
>Maurice 
>
>-----Message d'origine-----
>De : Mark Kessler [mailto:[email protected]]
>Envoyé : lundi 14 octobre 2013 21:34
>À : Users@flex
>Objet : Re: how to force redraw of custom spark buttonbar?
>
>Well you could use the fallback of.
>
>myButtonBar.dataProvider = null;
>myButtonBar.dataProvider = acButtonList;
>
>
>But if your using our 4.10 sdk or greator you can use
>myButtonBar.setButtonEnabled [1] / setButtonsEnabled
>
>[1]
>http://flex.apache.org/asdoc/spark/components/supportClasses/ButtonBarBase
>.html#setButtonEnabled%28%29
>
>
>-Mark
>
>
>On Mon, Oct 14, 2013 at 3:20 PM, <[email protected]> wrote:
>
>> Actually, what I tried was using an ArrayCollection instead of an
>> ArrayList for the dataProvider, then refreshing that ArrayCollection.
>> But, it didn't force a redraw.
>>
>> ----- Original Message -----
>>
>> From: [email protected]
>> To: [email protected]
>> Sent: Monday, October 14, 2013 12:11:45 PM
>> Subject: Re: how to force redraw of custom spark buttonbar?
>>
>> Yes, I tried that as well (forgot to mention it below).
>>
>> ----- Original Message -----
>>
>> From: "mark goldin" <[email protected]>
>> To: "users" <[email protected]>
>> Sent: Monday, October 14, 2013 12:05:46 PM
>> Subject: Re: how to force redraw of custom spark buttonbar?
>>
>> Did you try ArrayCollection(myBar.dataProvider).refresh() ?
>>
>>
>> On Mon, Oct 14, 2013 at 1:58 PM, <[email protected]> wrote:
>>
>> > (using SDK 4.10)
>> >
>> > I've tried each of the following (independently):
>> >
>> > myBar.invalidateDisplayList();
>> > myBar.invalidateProperties();
>> > myBar.invalidateSize();
>> > myBar.dataProvider=myDataProvider (e.g. changing the dataProvider,
>> > an
>> > ArrayList)
>> > myBar.includeInLayout=false; then later, myBar.includeInLayout=true;
>> >
>> > I have some custom logic in the first/middle/last button-skin that I
>> > want to execute to disable some buttons. I currently have it inside
>> >
>> > override protected function measure():void { ... }
>> >
>> > Any ideas I can try? Thanks in advance for any comments.
>> >
>>
>>
>>

Reply via email to