if you just want to concat the label then replace text=[EMAIL PROTECTED] with the 2 attributes
example in your cellrenderer
<?xml
version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.macromedia.com/2005/mxml" implements="mx.controls.listclasses.IDropInListItemRenderer"
xmlns="*">
<mx:Label id="Name" text="[EMAIL PROTECTED] + ' ' + [EMAIL PROTECTED]"/>
</mx:HBox>
<mx:HBox xmlns:mx="http://www.macromedia.com/2005/mxml" implements="mx.controls.listclasses.IDropInListItemRenderer"
xmlns="*">
<mx:Label id="Name" text="[EMAIL PROTECTED] + ' ' + [EMAIL PROTECTED]"/>
</mx:HBox>
however that said your tree renderer needs to implement the
IDropInListItemRenderer as above. This is
untested and may not work... in anycase have a look at
the
Interface IDropInListItemRenderer in the
help
Or even better you could do something in an as class like (again not
tested):
package SampleTreeRenderer {
import mx.controls.treeclasses.TreeCellRenderer;
/**
* this class allows us to set specific properties on a tree node
**/
public class Tree_Item extends mx.controls.treeclasses.TreeCellRenderer {
public function Vision_Tree_Item(){
super();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth,unscaledHeight);
//do all speacial drawing here
}
override public function set dataObject(value:Object):void {
super.dataObject=value;
import mx.controls.treeclasses.TreeCellRenderer;
/**
* this class allows us to set specific properties on a tree node
**/
public class Tree_Item extends mx.controls.treeclasses.TreeCellRenderer {
public function Vision_Tree_Item(){
super();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth,unscaledHeight);
//do all speacial drawing here
}
override public function set dataObject(value:Object):void {
super.dataObject=value;
//do your concat here or what
ever
if (value !=null){
if (value !=null){
[EMAIL PROTECTED] + ' ' + [EMAIL PROTECTED];
}
}
}
}
then on your tree you do a
listItemRenderer="Tree_Item"
hope this helps..
jason
-----Message d'origine-----Hi,
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]De la part de yair_iny
Envoyé : lundi 20 mars 2006 12:51
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Flex 2 Tree Behaviour override
I am evaluating Flex 2 Beta in comparison with Laszlo, in order to
make a choice on an RIA framework for our company.
As part of this evaluation I am trying to modify the Tree control
behaviour, to allow me to display structured text from more than one
XML attribute in my data source. I have tried doing this using
ListItemRenderer but it stops displaying all of the standard tree
behaviour as soon as I override it.
Does anyone know how to do this? Are there any examples of the tree
bahaviour being overriden?
Below are the sources for the two MXML files.
Thanks,
Yair Iny
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"
xmlns="*" layout="vertical">
<mx:XML id="TreeXML">
<folder name="Inbox" num="100">
<item name="Item1" num="50"/>
<folder name="Junk" num="20">
<item name="Item2" num="25"/>
</folder>
</folder>
</mx:XML>
<mx:Panel width="638" height="425" layout="absolute"
title="Problem View Mockup">
<mx:Tree dataProvider="{TreeXML}" rootVisible="false"
width="598" height="373" listItemRenderer="MyTreeRenderer">
</mx:Tree>
</mx:Panel>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*">
<mx:Label id="Name" text="[EMAIL PROTECTED]"/>
<mx:Label id="Count" text="[EMAIL PROTECTED]"/>
</mx:HBox>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.