BookVO Class
1 2 3 4 5 6 7 8 9 | package { [Bindable] public class BookVO { public var title:String = ""; public var author:String = ""; } } |
Figure 1.
Code 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:local="*" viewSourceURL="srcview/index.html"> <fx:Declarations> <s:ArrayCollection id="model"> <local:BookVO title="One Day at a Time" author="Danielle Steele"/> <local:BookVO title="The Lost Symbol" author="Dan Brown"/> <local:BookVO title="The Girl with the Dragon Tattoo" author="Stieg Larsson"/> <local:BookVO title="Shanghai Girls" author="Lisa See"/> <local:BookVO title="Crossroads" author="Belva Plain"/> <local:BookVO title="Cutting for Stone" author="Abraham Verghese"/> <local:BookVO title=" Precious" author="Sapphire"/> <local:BookVO title="The Man from Beijing" author="Henning Mankell"/> <local:BookVO title="Olive Kitteridge" author="Elizabeth Strout"/> <local:BookVO title="Hotel on the Corner of Bitter and Sweet" author="Jamie Ford"/> </s:ArrayCollection> </fx:Declarations> <s:layout> <s:VerticalLayout gap="5" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5"/> </s:layout> <mx:DataGrid dataProvider="{model}" width="100%" height="100%"/> <mx:DataGrid dataProvider="{model}" width="100%" height="100%"/> </s:Application> |
Figure 2.
Code 2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:local="*"> <fx:Declarations> <s:ArrayList id="model"> <local:BookVO title="One Day at a Time" author="Danielle Steele"/> <local:BookVO title="The Lost Symbol" author="Dan Brown"/> <local:BookVO title="The Girl with the Dragon Tattoo" author="Stieg Larsson"/> <local:BookVO title="Shanghai Girls" author="Lisa See"/> <local:BookVO title="Crossroads" author="Belva Plain"/> <local:BookVO title="Cutting for Stone" author="Abraham Verghese"/> <local:BookVO title=" Precious" author="Sapphire"/> <local:BookVO title="The Man from Beijing" author="Henning Mankell"/> <local:BookVO title="Olive Kitteridge" author="Elizabeth Strout"/> <local:BookVO title="Hotel on the Corner of Bitter and Sweet" author="Jamie Ford"/> </s:ArrayList> <mx:ListCollectionView id="collection1" list="{model}" /> <mx:ListCollectionView id="collection2" list="{model}" /> </fx:Declarations> <s:layout> <s:VerticalLayout gap="5" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5"/> </s:layout> <mx:DataGrid dataProvider="{collection1}" width="100%" height="100%"/> <mx:DataGrid dataProvider="{collection2}" width="100%" height="100%"/> </s:Application> |
johnnygod
Nathan,
What is /> in these examples ?