[flexcoders] Custom component itemRenderer

2009-05-11 Thread kpjj31
Is it possible to pass data into an itemRenderer that is not apart of the 
dataProvider. The component I am using as an does not seem to except
bindable data when it's used as an item Renderer.


coursedays and unittypes are both arrayCollections from remoteObjects.

The itemRender is using data. from coursedays. But I also want to
pass in the arrayCollection of unittypes. Is this the correct opproach?

mx:HorizontalList id=days_hlist useRollOver=false width=980 height=570 
borderStyle=none selectable=false horizontalScrollPolicy=off left=0  
dataProvider={coursedays}

mx:itemRenderer
mx:Component
courseeditor:dayoutline unittypes={unittypes}/ 
/mx:Component
/mx:itemRenderer

/mx:HorizontalList



Re: [flexcoders] Custom component itemRenderer

2009-05-11 Thread Jeffry Houser

kpjj31 wrote:
 Is it possible to pass data into an itemRenderer that is not apart of the 
 dataProvider. 
 Yes, but I would not consider it trivial.  You must extend the 
component creating the itemRenderers and modify it to pass in your 
additional data. 

 Most itemRenderers also have a ListData component, which has an owner 
attribute that give you hook into the list.  So if you can get to your 
data using that owner property, it may work for you.  Or you can create 
your own ListData component and modify your list based class to create 
your new ListData component instead of the built in one and pass that to 
itemRenderers. 

 You may also be able to use a singleton, conceptually similar to 
Cairngorm's ModelLocator to access the data hanging out in the middle 
of nowhere.

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust




RE: [flexcoders] Custom component itemRenderer

2009-05-11 Thread Tracy Spratt
Speaking only from what I have read here, I believe if you set the renderer
using  ActionScript and the ClassFactory, you can set properties on the
renderer.  

 

Ah, from one of alex's posts: If you look at ClassFactory, it has a
properties map that will copy any properties in the map to each instance. 

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jeffry Houser
Sent: Monday, May 11, 2009 6:26 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Custom component itemRenderer

 







kpjj31 wrote:
 Is it possible to pass data into an itemRenderer that is not apart of the
dataProvider. 
Yes, but I would not consider it trivial. You must extend the 
component creating the itemRenderers and modify it to pass in your 
additional data. 

Most itemRenderers also have a ListData component, which has an owner 
attribute that give you hook into the list. So if you can get to your 
data using that owner property, it may work for you. Or you can create 
your own ListData component and modify your list based class to create 
your new ListData component instead of the built in one and pass that to 
itemRenderers. 

You may also be able to use a singleton, conceptually similar to 
Cairngorm's ModelLocator to access the data hanging out in the middle 
of nowhere.

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl. http://tinyurl.com/684b5h
com/684b5h
http://www.twitter. http://www.twitter.com/reboog711 com/reboog711 |
Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras http://www.flextras.com?c=104 .com?c=104
--
http://www.theflexs http://www.theflexshow.com how.com
http://www.jeffryho http://www.jeffryhouser.com user.com
--
Part of the DotComIt Brain Trust





Re: [flexcoders] Custom component itemRenderer

2009-05-11 Thread Jeffry Houser


I didn't know that, definitely gonna have to check that out. 


Tracy Spratt wrote:


Ah, from one of alex's posts: If you look at ClassFactory, it has a 
properties map that will copy any properties in the map to each 
instance. 

--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust