Bindings into a ui component usually happen right before that component
fires its "initialize" event. So what you can do is in your setter see if
you need to wait and defer your highlightDays call until the component is
ready (you could either wait for an event or maybe even use doLater
(http://livedocs.macromedia.com/flex/1/asdocs/mx/core/UIObject.html#doLater)
).

As far as the events firing before internal components are ready I'm
honestly not sure why that would be. In general creationComplete means that
everything is good to go, but maybe you need to wait a little after that
using a doLater?

Matt

-----Original Message-----
From: Dirk Eismann [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 02, 2004 12:57 PM
To: [email protected]
Subject: [flexcoders] Bindings and custom properties

What steps are necessary to make custom property bindings work correctly
in mxml components? There seem to be initialization/timing issues when
extending complex components. I wanted to add a property to the
DateChooserEx component. I did all the following:

1) the property is defined as a private member of the class (private var
_highlight:Array;)
2) the property has getters/setters defined
3) the setter function calls highlightDays()

The mxml looks like this:

<DateChooserEx id="cal" highlight="{myArray}" />

This does not work immediately. The setter function gets called and also
the internal highlightDays function executes but it seems as if the
nested components inside the DateChooser control are not
finished/initialized when the binding executes for the first time. 

Also, the events emitted by the DateChooserEx control (especially
creationComplete and show) seem to be triggered prior all internal
elements are rendered.

Any thoughts?

Dirk.




Yahoo! Groups Links






Reply via email to