On 1/8/06, Manish Jethani <[EMAIL PROTECTED]> wrote:
> On 1/5/06, Michael Hansen <[EMAIL PROTECTED]> wrote:
>
> > Check out the example here:
> >
> > http://www.mindinteraction.com/bin/TestDataGrid2.html  (Note Flex2 app)
> >
> > >Drag an item to generate an exception.<
>
> > Basically it's a drag enabled datagrid using drop-in cellrenderer. I'm 
> > unsure if the exception
> > is my fault or a bug. The docs on drop-in cell renderers is not that 
> > exhaustive.
>
> Looks like a bug.  I've logged it.
>

Revisiting this -- it's not a bug.

When 'dataObject' is set on the cell renderer object, the object's
children have not been created yet, because the object still hasn't
been added to the display list.  Generally, properties are set first
and the object is added to the display list afterwards.  So in a
property setter, it cannot be assumed that child objects will be
available.

To get around this, don't set 'chk' in the 'dataObject' setter. 
Instead, call 'invalidateProperties' and do the rest in
'commitProperties'.

 public function set dataObject(value:Object):Void
 {
  _dataObject = value;
  invalidateProperties();
 }

 override public function commitProperties():Void
 {
  super.commitProperties();

  if (dataObject)
   chk.selected = dataObject.selected; // or whatever
 }

I hope this helps.

As mentioned in my previous message, in Beta 1, you won't have to do
all this, because binding works for the 'dataObject' property.

 <CheckBox selected="{dataObject.selected}" />


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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to