flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: AW: DG (class is not an IEventDispatcher)
Date Fri, 12 Dec 2014 17:06:08 GMT
Prepare() doesn’t really lend itself to using data binding.  Prepare()
might get called at a better time than the data setter, such as when more
widgets in the renderer are ready, so that’s why it is often recommended.

The data setter is of type Object, and you can’t bind to Objects so the
compiler gives you a warning.  If the runtime actually finds an Object, it
will also give you a warning.  If the data is actually bindable, you can
often get the warnings to go away by binding to
{MyCompanyObject(data).company} so the compiler knows the actual type of
data and can see it is bindable.

DataGrids refresh entire rows as the data provider changes.  The
collection notification system basically works that way.  But if the
collection hasn’t been notified that a field in the object has changed,
then the renderer won’t pick up the change until the collection is finally
notified.

HTH,
-Alex

On 12/12/14, 1:30 AM, "Krüger, Olaf" <OKrueger@edscha.com> wrote:

>> I'm guessing that the 'set data()' function is preferred over the
>>'prepare()' function but I seem to recall reading somewhere that
>>'prepare()' is more efficient.
>I'm always override the 'set data()' setter if I have to do something
>'special' inside the ItemRenderer, but I don't know if this is the most
>efficient way.
>The most examples out there, also these provided by adobe, are using this
>way I think.
>
>
>
>-----Ursprüngliche Nachricht-----
>Von: DavidM [mailto:dmoshal@gmail.com]
>Gesendet: Freitag, 12. Dezember 2014 09:40
>An: users@flex.apache.org
>Betreff: Re: DG (class is not an IEventDispatcher)
>
>Olaf,
>
>Both my examples above work, even though dataField is not specified.
>
>It would appear that the GridItemRenderer triggers on row changes, not
>data
>field changes.
>
>This makes sense to me because often you want to create a nested
>structure in a cell that reacts to more than one datafield.
>
>I'm guessing that the 'set data()' function is preferred over the
>'prepare()' function but I seem to recall reading somewhere that
>'prepare()'
>is more efficient.
>
>From what I can see in the debugger, they both get called, set data()
>before
>prepare()
>
>Any thoughts?
>
>Dave
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/DG-class-is-not-an-IEventDi
>spatcher-tp9124p9130.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.
>[Merry Christmas - Frohe Weihnachten - Feliz Navidad - Joyeux Noel -
>Vesele Vanoce]
>
>________________________________
>
>Edscha Holding GmbH
>Sitz der Gesellschaft: Remscheid
>Registergericht: Wuppertal, HRB 22889
>Geschäftsführung: Francisco J. Riberas Mera, Francisco López Peña, David
>Vázquez Pascual, Torsten Greiner, Markus Kirchner, Hans-Peter Schulz und
>Volker Weiss
>
>Vertretungsberechtigt sind nur Geschäftsführer und schriftlich
>Bevollmächtigte.
>
>Solely Managing Directors or employees with a written proxy have got
>power of representation.
>
>Der Inhalt dieser E-Mail einschließlich etwaiger beigefügter Dateien ist
>vertraulich und nur für den Empfänger bestimmt. Sollten Sie nicht der
>bestimmungsgemäße Empfänger sein, ist Ihnen jegliche Offenlegung,
>Vervielfältigung, Weitergabe oder Nutzung des Inhalts untersagt. Bitte
>informieren Sie in diesem Fall unverzüglich den Absender und löschen Sie
>die E-Mail einschließlich etwaiger beigefügter Dateien von Ihrem System.
>Vielen Dank.
>
>The contents of this e-mail including any attachments are confidential
>and may be legally privileged. If you are not the intended recipient, any
>disclosure, copying, distribution or use of its contents is strictly
>prohibited, and you should please notify the sender immediately and then
>delete this e-mail including any attachments from your system. Thank you.

Mime
View raw message