I like this idea.  Seems a bit cleaner than having to add IUID interfaces to the VOs just to use them in list components.

 

Thanks for the example!

 


From: [email protected] [mailto:[email protected]] On Behalf Of Peter Blazejewicz
Sent: Tuesday, March 28, 2006 10:40 AM
To: [email protected]
Subject: [flexcoders] Re: List Component Bug!!

 

Hi everyone,

I've ended with "boxing" items into ObjectProxy that way:

[code]

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
      creationComplete="initApp();">
      <mx:Script>
            <![CDATA[
                  import mx.controls.Alert;
                  import mx.utils.ObjectProxy;
                  import mx.collections.ArrayCollection;
                  [Bindable]
                  private var arrayColl:ArrayCollection;
                  //
                  private function initApp():void{
                        var arr:Array = new Array(10);
                        for(var i:uint =0;i<arr.length;i++){
                              arr[i] = new ObjectProxy(new MyCustomItemVO("peter "+i,
"blazejewicz "+i));
                        }
                        arrayColl = new ArrayCollection(arr);
                  }
            ]]>
      </mx:Script>
      <mx:List id="testList" width="400" height="300"
            dataProvider="{arrayColl}" labelField="firstName"
            itemClick="Alert.show(testList.selectedItem.firstName);"/>
</mx:Application>

package {
      public class MyCustomItemVO {
            [Bindable]
            public var firstName:String;
            [Bindable]
            public var surname:String;
            public function MyCustomItemVO(firstName:String, surname:String){
                  this.firstName = firstName;
                  this.surname = surname;
            }
      }
}

but I would welcome something built-in instead of above solution or
using IUUD interface,

regards,
Peter Blazejewicz






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to