You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mo...@comcast.net on 2013/10/14 20:58:18 UTC
how to force redraw of custom spark buttonbar?
(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.
Re: how to force redraw of custom spark buttonbar?
Posted by mo...@comcast.net.
Thanks so much for everyone's advice. It's working now with Mark Kessler's suggestion to take advantage of SDK 4.10's setButtonEnabled property.
----- Original Message -----
From: "Maurice Amsellem" <ma...@systar.com>
To: users@flex.apache.org
Sent: Monday, October 14, 2013 12:49:55 PM
Subject: RE: how to force redraw of custom spark buttonbar?
> > 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:kesslerconsulting@gmail.com]
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, <mo...@comcast.net> 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: modjklist@comcast.net
> To: users@flex.apache.org
> 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" <ma...@gmail.com>
> To: "users" <us...@flex.apache.org>
> 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, <mo...@comcast.net> 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.
> >
>
>
>
Re: how to force redraw of custom spark buttonbar?
Posted by Alex Harui <ah...@adobe.com>.
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" <ma...@systar.com>
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:kesslerconsulting@gmail.com]
>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, <mo...@comcast.net> 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: modjklist@comcast.net
>> To: users@flex.apache.org
>> 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" <ma...@gmail.com>
>> To: "users" <us...@flex.apache.org>
>> 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, <mo...@comcast.net> 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.
>> >
>>
>>
>>
RE: how to force redraw of custom spark buttonbar?
Posted by Maurice Amsellem <ma...@systar.com>.
> > 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:kesslerconsulting@gmail.com]
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, <mo...@comcast.net> 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: modjklist@comcast.net
> To: users@flex.apache.org
> 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" <ma...@gmail.com>
> To: "users" <us...@flex.apache.org>
> 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, <mo...@comcast.net> 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.
> >
>
>
>
Re: how to force redraw of custom spark buttonbar?
Posted by Mark Kessler <ke...@gmail.com>.
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, <mo...@comcast.net> 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: modjklist@comcast.net
> To: users@flex.apache.org
> 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" <ma...@gmail.com>
> To: "users" <us...@flex.apache.org>
> 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, <mo...@comcast.net> 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.
> >
>
>
>
Re: how to force redraw of custom spark buttonbar?
Posted by mo...@comcast.net.
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: modjklist@comcast.net
To: users@flex.apache.org
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" <ma...@gmail.com>
To: "users" <us...@flex.apache.org>
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, <mo...@comcast.net> 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.
>
Re: how to force redraw of custom spark buttonbar?
Posted by mo...@comcast.net.
Yes, I tried that as well (forgot to mention it below).
----- Original Message -----
From: "mark goldin" <ma...@gmail.com>
To: "users" <us...@flex.apache.org>
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, <mo...@comcast.net> 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.
>
Re: how to force redraw of custom spark buttonbar?
Posted by mark goldin <ma...@gmail.com>.
Did you try ArrayCollection(myBar.dataProvider).refresh() ?
On Mon, Oct 14, 2013 at 1:58 PM, <mo...@comcast.net> 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.
>