[flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread Amy
--- In flexcoders@yahoogroups.com, sdl1326 [EMAIL PROTECTED] wrote:

 I am using the Tile Component along with a repeater and then a custom
 component (image control). Is it possible to give the custom component
 a unique id/name? I have tried to use a variable associated with the
 current repeater item ({repeater.currentItem.name}), however, it does
 not seem that this is possible as I am getting an error that the ID is
 not a valid identifier.
 
 Thanks for any and all replies.


If you have something like this:

mx:Repeater id=theRepeater dataProvider={yourAC}
   yourNS:YourComponent id=foo/
/mx:Repeater

then you can refer to any repeated component by its index within foo.  
i.e. foo[0] is the first component.  This is pretty thoroughly 
documented in the help for Repeater.

HTH;

Amy



[flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread sdl1326
Thanks. I believe that's exactly what I need. I will also check out
the 'help' section for the repeater.

Thanks again.

--- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote:
 
  I am using the Tile Component along with a repeater and then a custom
  component (image control). Is it possible to give the custom component
  a unique id/name? I have tried to use a variable associated with the
  current repeater item ({repeater.currentItem.name}), however, it does
  not seem that this is possible as I am getting an error that the ID is
  not a valid identifier.
  
  Thanks for any and all replies.
 
 
 If you have something like this:
 
 mx:Repeater id=theRepeater dataProvider={yourAC}
yourNS:YourComponent id=foo/
 /mx:Repeater
 
 then you can refer to any repeated component by its index within foo.  
 i.e. foo[0] is the first component.  This is pretty thoroughly 
 documented in the help for Repeater.
 
 HTH;
 
 Amy





[flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread valdhor
I don't know about most people but I never need to know the id of a
repeated item.

All of the items I have in a repeater are instances of a specific
object. This object has class members and functions and can do
everything it needs to do on its own. If I need it to (Which is
infrequent) each object can get to its parent or even the Application
object itself.

So, I ask, Why would you need to refer to a repeated component?


--- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote:
 
  I am using the Tile Component along with a repeater and then a custom
  component (image control). Is it possible to give the custom component
  a unique id/name? I have tried to use a variable associated with the
  current repeater item ({repeater.currentItem.name}), however, it does
  not seem that this is possible as I am getting an error that the ID is
  not a valid identifier.
  
  Thanks for any and all replies.
 
 
 If you have something like this:
 
 mx:Repeater id=theRepeater dataProvider={yourAC}
yourNS:YourComponent id=foo/
 /mx:Repeater
 
 then you can refer to any repeated component by its index within foo.  
 i.e. foo[0] is the first component.  This is pretty thoroughly 
 documented in the help for Repeater.
 
 HTH;
 
 Amy





[flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread sdl1326
Adobe must have thought at least more than one person would need the
functionality otherwise I don't think they would have thoroughly 
documented it in the help section.

--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 I don't know about most people but I never need to know the id of a
 repeated item.
 
 All of the items I have in a repeater are instances of a specific
 object. This object has class members and functions and can do
 everything it needs to do on its own. If I need it to (Which is
 infrequent) each object can get to its parent or even the Application
 object itself.
 
 So, I ask, Why would you need to refer to a repeated component?
 
 
 --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
 
  --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote:
  
   I am using the Tile Component along with a repeater and then a
custom
   component (image control). Is it possible to give the custom
component
   a unique id/name? I have tried to use a variable associated with the
   current repeater item ({repeater.currentItem.name}), however, it
does
   not seem that this is possible as I am getting an error that the
ID is
   not a valid identifier.
   
   Thanks for any and all replies.
  
  
  If you have something like this:
  
  mx:Repeater id=theRepeater dataProvider={yourAC}
 yourNS:YourComponent id=foo/
  /mx:Repeater
  
  then you can refer to any repeated component by its index within
foo.  
  i.e. foo[0] is the first component.  This is pretty thoroughly 
  documented in the help for Repeater.
  
  HTH;
  
  Amy
 





RE: [flexcoders] Re: Setting unique ID with repeater and custom component

2008-06-27 Thread Tracy Spratt
Repeater is much more flexible than many people think. It is often
thought of as a way to make a list, but is really more a dataProvider
driven wrapper for addChild and removeChild, with a few other cool
things built in.

 

I can imagine several use cases for needing to reference a repeated
item.  I have done it myself, though if I were to reproduce today the
particular functionality I am thinking of, I would use events instead.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of valdhor
Sent: Friday, June 27, 2008 11:51 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Setting unique ID with repeater and custom
component

 

I don't know about most people but I never need to know the id of a
repeated item.

All of the items I have in a repeater are instances of a specific
object. This object has class members and functions and can do
everything it needs to do on its own. If I need it to (Which is
infrequent) each object can get to its parent or even the Application
object itself.

So, I ask, Why would you need to refer to a repeated component?

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , sdl1326 azsl1326-email@
wrote:
 
  I am using the Tile Component along with a repeater and then a
custom
  component (image control). Is it possible to give the custom
component
  a unique id/name? I have tried to use a variable associated with the
  current repeater item ({repeater.currentItem.name}), however, it
does
  not seem that this is possible as I am getting an error that the ID
is
  not a valid identifier.
  
  Thanks for any and all replies.
 
 
 If you have something like this:
 
 mx:Repeater id=theRepeater dataProvider={yourAC}
 yourNS:YourComponent id=foo/
 /mx:Repeater
 
 then you can refer to any repeated component by its index within foo. 
 i.e. foo[0] is the first component. This is pretty thoroughly 
 documented in the help for Repeater.
 
 HTH;
 
 Amy