So let’s say what you currently have is this:

 

[Bindable]

public var foo:Object;

 

You would change that to:

 

private var _foo:Object;

 

[Bindable(“fooChanged”)]

Public function get foo():Object

{

  Return _foo;

}

 

Public function set foo(f:Object):void

{

_foo = f;

  dispatchEvent(new Event(“fooChanged”));

}

 

Then you addEventListener(“fooChanged”, your handler that calls refresh) and voila!

More details on the [bindable] tag are here: http://livedocs.macromedia.com/flex/2/docs/00001653.html

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Bromberger
Sent: Wednesday, September 20, 2006 12:06 AM
To: [email protected]
Subject: RE: [flexcoders] Custom Component Updates...

 

Hi Matt,

 

            Thanks for your response; basically I want the como box to listen for the change to a bindable public variable I have set up. Then when that variable is changed from outside the component, from another combo or datagrid etc… I then want the filterFunction to use that variable and update the array in the component. It does sound like making the getter/setter and dispatching the event is what I would want to do. I am pretty green with this; can you point me to some resources that will get me going on this??

-Ken

 


From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On Behalf Of Matt Chotin
Sent: Tuesday, September 19, 2006 11:40 PM
To: [EMAIL PROTECTED]ups.com
Subject: RE: [flexcoders] Custom Component Updates...

 

What property is the combo box supposed to pay attention to.  Should you just be overriding a setter on the ComboBox so that you’re aware when the data changes?  Or is this binding to the variable that’s used in the filterFunction that you want to do?  Maybe rather than making that variable [Bindable] on its own you should make it a getter/setter and dispatch your own even that you can listen for.

 

Matt

 


From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On Behalf Of Ken Bromberger
Sent: Tuesday, September 19, 2006 3:24 PM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Custom Component Updates...

 

Hi All,

 

                        I have a custom component, a combo box that I have applied an ArrayCollection filter to that accepts a variable to filter on. I am able to trigger and filter the combo box externally but what I would like to do is have the combo box listen for when it’s binding changes and then update the filter all within the component. What would be the best practice for doing this?? I have looked at ChangeWatcher and this does seem like it could work… Does anyone have suggestions or examples???

 

-Ken

 

 

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to