One primary benefit is that you can forget about getRepeaterItem(). Pass
in a reference to the entire item,and implement a getter and setter, and
your event handlers have direct access to the whole item through the
event.target property.  Type the item specifically and avoid the "Class
XML is not an IEventDispatcher" warnings

 

Defining a click event is easier to do and to read.

 

It is generally cleaner and easier to write and maintain.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of danielvlopes
Sent: Sunday, September 16, 2007 4:36 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Problem with repeater and image ???

 

What will be diferent when i repeat custom comps?

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Use a custom component for the repeated view, it simplifies things
like
> this.
> 
> Tracy
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Alex Harui
> Sent: Sunday, September 16, 2007 12:14 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Problem with repeater and image ???
> 
> 
> 
> Target is the dispatcher, which is the loader of the image. Try
> currentTarget, or use rptFoto.getRepeaterItem
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of danielvlopes
> Sent: Saturday, September 15, 2007 8:57 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Problem with repeater and image ???
> 
> 
> 
> Helo everybody...
> 
> I having problems to try get repearter item when user click on image.
> 
> This is my code for repeater:
> <mx:Repeater id="rptFoto" dataProvider="{objSelectedEquip.thumbs}">
> <mx:HBox>
> <mx:Image 
> source="{rptFoto.currentItem}" 
> buttonMode="true"
> useHandCursor="true"
> toolTip="Vizualizar"
> click="exibirImagem(event)"/>
> <mx:Button label="Alterar" click="exibirImagem(event)" /> 
> </mx:HBox> 
> </mx:Repeater>
> 
> When user click on button or image this function is called:
> 
> private function exibirImagem(event:MouseEvent):void{
> 
> var image:String = event.target.getRepearterItem();
> var imgUrl:URLRequest = new
> URLRequest(Funcoes.getImageFromThumb(image));
> navigateToURL(imgUrl,"_blank");
> }
> 
> When user click on button everything work, but whe click image this
> error is dispatched "Property getRepeaterItem not found on
> mx.core.FlexLoader and there is no default value." , anyone know some
> way to fix this?
> 
> Thanks.
>

 

Reply via email to