Hello;

I'm trying to get some understanding of renderers for lists and data 
grids. I'm working with, and adapting, the sample code presented in 
the Flex 2 documentation. Here's what I have (catalog.xml is from 
the flexstore example):

------ prototype.mxml -----

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"; 
xmlns:local="*">

    <mx:Model id="catalog" source="assets/catalog.xml"/>

    <mx:HorizontalList
        dataProvider="{catalog.product}"
        width="100%"
        listItemRenderer="Thumbnail"
        columnWidth="120"
        height="140" hScrollPolicy="on"/>
</mx:Application>

----- Thumbnail.mxml -----

<?xml version="1.0" encoding="utf-8"?>    
<mx:VBox xmlns:mx="http://www.macromedia.com/2005/mxml";
         horizontalAlign="center"
         verticalGap="0" 
         borderStyle="none" >
    
    <mx:Script>
        <![CDATA[
        
                override public function set dataObject
(value:Object):void
                {
                                super.dataObject = value;
                                trace( value.image, image);
                                
                                if( image != null )
                                {
                                        image.source = value.image;
                                }
                }
        ]]>
    </mx:Script>
         
        <mx:Image id="image" width="60" height="60" 
horizontalAlign="center"/>      
</mx:VBox>

------ debugger output ------

[SWF] C:\Documents and Settings\tpatton\My Documents\Flex\Prototype1
\bin\Prototype1-debug.swf - 615,987 bytes after decompression
assets/pic/Nokia_6010.gif 
Application_5._HorizontalList1:HorizontalList.ListBaseContentHolder_1
0.hiddenItem:VBox.image:Image
assets/pic/Nokia_6010.gif null
assets/pic/Nokia_3100_blue.gif null
assets/pic/Nokia_3100_pink.gif null
assets/pic/Nokia_3120.gif null
assets/pic/Nokia_3220.gif null
assets/pic/Nokia_3650.gif null
assets/pic/Nokia_6820.gif null
assets/pic/Nokia_6670.gif null
assets/pic/Nokia_6620.gif null
[Unload SWF] C:\Documents and Settings\tpatton\My 
Documents\Flex\Prototype1\bin\Prototype1-debug.swf


>From the output we can see that the dataObject setter function is 
being called once when the image parameter is a real value, but for 
all subsequent calls, the image parameter is null.

Why would this be? It's hard to set the source parameter of null.

Thanks.
Tobias.









--
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