7 Replies Latest reply on Nov 23, 2009 10:24 AM by manofspirit

    List control with custom item renderer selection/highlight problem

    manofspirit Level 1

      Hi

      I created a sample project to illustrate my problem, my data provider actually use identical value objects like there could be same objects with same data in an array collection.

       

      When i bring mouse over the list control, i dont get any sky blue selection/highlight and i cant even click over them and am not getting any change event either.


      Here is the code, You can also download attached project file and experience it locally.

      List Problem

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application creationComplete="compApp();" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
           <mx:Script>
                <![CDATA[
                     import mx.collections.ArrayCollection;
                     
                     [Bindable] private var dp:ArrayCollection = new ArrayCollection();
                     
                     private function compApp():void{
                          for(var i:Number =0; i < 10; i++){                         
                               var person:Person = new Person("Raza", "raza.jpg");
                               dp.addItem(person);                         
                          }
                     }     
                     
                ]]>
           </mx:Script>
           
           <mx:List variableRowHeight="true" width="200" height="300" id="listControl" dataProvider="{dp}" itemRenderer="ListRenderer"/>     
      </mx:Application>
      

       

      Item Renderer

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle">
           <mx:Script>
                <![CDATA[
                     
                     override public function set data(value:Object):void{
                          if(!value){
                               return;
                          }
                          fullName.text = Person(value).name;
                          photo.source = Person(value).photo;
                     }
                     
                     
                ]]>
           </mx:Script>
           <mx:Image id="photo"/>
           <mx:Label id="fullName"/>
      </mx:HBox>
      
      

       

       

      Thanks