flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Help Error TileList
Date Mon, 18 Mar 2013 16:54:06 GMT
Hi Marcio,

Do not set the name="CustomItemRenderer".

The list classes need to autogenerate a name in order to track different
renderer instances.

-Alex


On 3/18/13 9:13 AM, "Marcio Fermino" <prologicasistemas@gmail.com> wrote:

> same problem
> 
> the code
> 
> <?xml version="1.0" encoding="utf-8"?>
> <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
>   xmlns:s="library://ns.adobe.com/flex/spark"
>   xmlns:mx="library://ns.adobe.com/flex/mx" width="686" height="494"
> creationComplete="titlewindow1_creationCompleteHandler(event)">
> 
> <fx:Declarations>
> 
> <mx:RemoteObject id="imagemDAO" destination="ImagemDAO"
> fault="erro_tela(event)">
> <mx:method fault="erro_tela(event)" name="Consultar" result="
> mostraDados_Imagem(event)"/>
> </mx:RemoteObject>
> 
> 
> </fx:Declarations>
> 
> 
> 
> <fx:Script>
> <![CDATA[
> import mx.collections.ArrayCollection;
> import mx.containers.FormItem;
> import mx.controls.Alert;
> import mx.controls.Image;
> import mx.controls.Text;
> import mx.core.Application;
> import mx.core.FlexGlobals;
> import mx.effects.Resize;
> import mx.events.CloseEvent;
> import mx.events.DropdownEvent;
> import mx.events.FlexEvent;
> import mx.events.ItemClickEvent;
> import mx.events.ListEvent;
> import mx.events.ResizeEvent;
> import mx.formatters.CurrencyFormatter;
> import mx.formatters.NumberFormatter;
> import mx.managers.FocusManager;
> import mx.managers.PopUpManager;
> import mx.rpc.events.FaultEvent;
> import mx.rpc.events.ResultEvent;
> import mx.validators.ValidationResult;
> 
> private var img2:Image;
> 
> [Bindable]private var arraylist_imagem:ArrayCollection;
> 
> protected function titlewindow1_creationCompleteHandler(event:FlexEvent):void{
> imagemDAO.Consultar("SELECT * FROM imagem");
> }
> 
> 
> private function erro_tela(event:FaultEvent) : void  {
> Alert.show(event.fault.message);
> }
> 
> 
> public function mostraDados_Imagem(event:ResultEvent) : void {      
> arraylist_imagem = event.result as ArrayCollection;    
> }
> 
> ]]>
> </fx:Script>
> 
> 
> <mx:TileList id="tileList" x="21" y="9" width="635" height="346"
> columnCount="4" 
> columnWidth="125" dataProvider="{arraylist_imagem}"
>     itemRenderer="CustomItemRenderer"
> rowCount="2" rowHeight="100" verticalScrollPolicy="on"/>
> 
> 
> </s:TitleWindow>
> 
> 
> 
> 
> ItemRenderer
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!-- 
> http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-t
> he-flex-horizontallist-control/ -->
> <mx:VBox name="CustomItemRenderer"
> xmlns:mx="http://www.adobe.com/2006/mxml"
> horizontalAlign="center"
> verticalAlign="middle">
> 
> 
> 
> <mx:Image id="imagem" x="-16" y="-19" width="162" height="142"
>  source="{data.caminho}" />
> 
> <mx:Label text="{data.nome}" />
> 
> </mx:VBox>
> 
> 
> 
> Em 18/03/2013, às 13:03, manish sharma <minisharma17@gmail.com> escreveu:
> 
>> creationPolicy = "All"
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message