Source Code:
BasicViewAppUserListView.mxml
<?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="Cool People"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:layout> <s:VerticalLayout paddingTop="10" /> </s:layout> <fx:Script> <![CDATA[ import spark.events.IndexChangeEvent; protected function userList_changeHandler(event:IndexChangeEvent):void { // TODO Auto-generated method stub navigator.pushView(views.UserProfile, userList.selectedItem); } ]]> </fx:Script> <s:Label text="Choose a Cool Person" paddingLeft="10" /> <s:List id="userList" width="100%" height="100%" labelField="name" change="userList_changeHandler(event)"> <s:ArrayCollection> <fx:Object name="Name 1 Lee" job="Adobe Evangelist" /> <fx:Object name="Name 2 Brent" job="Flex geek" /> <fx:Object name="Name 3 Ryan" job="Adobe Engelist" /> <fx:Object name="Name 4 Steve" job="Cool Gadget guy" /> </s:ArrayCollection> </s:List> </s:View>
No comments:
Post a Comment