Thank you Tracy for your answer, 

You are probably right about the bad design of my application. I know
that the dataprovider  component is used to pass data and not complete
object. However my case is a little bit different (maybe there is an
other way to assess my issue...) because I don't want to display a
basic visual compound. Each of the displayed compound has to do an
additional task; in my case a remote call via a RemoteObject.

The only way I found to display these "living" object was to build the
object, then to store it in an ArrayCollection and finally to reactive
it in the datagrid (relifeData).

Thanks for the data() function. I didn't know what was triggered by
the addition of items in my grid.



--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> First, a dataProvider should contain data.  It looks like you are
> putting ui components in the dataProvider.  Unless you are working a
> very extreme edge-case, you do not want to do that.  What are you trying
> to accomplish?
> 
>  
> 
> Second, you cannot use creationComplete to show row/item level UI in a
> renderer.  All display work in a renderer must happen as the result of
> the framework's call to the set data() function.  Typically, one
> overrides set data().
> 
>  
> 
> I think you may have some basic misconceptions to work through.
> 
>  
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of y.mauron
> Sent: Monday, June 02, 2008 4:04 AM
> To: [email protected]
> Subject: [flexcoders] First row trouble with datagrid component
> 
>  
> 
> 
> topic summary : 
> The first element of my dataprovider is not shown and there is always
> an empty line as the first line of my datagrid
> 
> Dear all,
> 
> I think my question is entirely explained in the topic summary of this
> post. I have a datagrid that uses a item renderer. The main app is
> defined like in the first part of the attached code. The itemrenderer
> looks like the second part of the attached code.
> 
> When I run it, the first item of my dataprovider is not shown while
> the first line of my datagrid is always empty... Any idea to explain
> this strange behavior ?
> 
> Thanks in advance...
> 
> Attach Code
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> layout="absolute" creationComplete="init()">
> 
> <mx:Script>
> <![CDATA[
> import mx.containers.VBox;
> import mx.controls.Alert;
> import mx.controls.Image;
> import mx.collections.ArrayCollection;
> public var essai2:ArrayCollection = new ArrayCollection();
> 
> public function init():void{
> var img:Image = new Image();
> img.source = "1.gif";
> var box1:VBox = new VBox();
> box1.addChild(img);
> essai2.addItem(box1);
> essai2.addItem(box1);
> }
> 
> 
> ]]>
> </mx:Script>
> 
> <mx:DataGrid x="10" y="10" id="dg" dataProvider="{essai2}"
> width="100%" height="100%">
> <mx:columns>
> 
> <mx:DataGridColumn itemRenderer="{new ClassFactory(relifeData)}">
> 
> </mx:DataGridColumn>
> </mx:columns>
> </mx:DataGrid>
> 
> </mx:Application>
> 
> __________________________________________________________
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> "
> creationComplete="addComp()">
> 
> <mx:Script>
> <![CDATA[
> import mx.controls.Alert;
> 
> function addComp():void{
> 
> boxContainer.addChild(DisplayObject(data));
> 
> }
> ]]>
> </mx:Script>
> 
> 
> <mx:Box id="boxContainer">
> 
> </mx:Box>
> 
> </mx:Canvas>
>


Reply via email to