flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From After24 <vinc...@after24.net>
Subject ItemRenderer declaration in MXML
Date Sat, 19 Jul 2014 11:08:47 GMT
Hello,

I'm building a custom component with an itemRenderer public property :

public function get itemRenderer():IFactory
{
	return _itemRenderer;
}
		
public function set itemRenderer(value:IFactory):void
{
	_itemRenderer = value;
        .....
}

So the setter is waiting for an IFactory.

In MXML, for components like spark List or Datagrid, the itemRenderer
property can be set with the following declaration :
itemRenderer="com.foo.ItemRenderClass"

I would like to understand the mechanism that allow the conversion of the
String into an IFactory.
I guess the compiler checks if com.foo.ItemRenderClass exists and, if true,
returns a new ClassFactory(ItemRenderClass) ?

Is it possible to get the same behavior with a custom component, I mean
having the possibility to use a classPath String in MXML while the setter of
the property is waiting for a different type (like an Ifactory in my case) ?
is it based on Metadata ?

Thank you.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/ItemRenderer-declaration-in-MXML-tp7339.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message