Created
April 25, 2013 15:44
-
-
Save jacobheric/5460761 to your computer and use it in GitHub Desktop.
some flex code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" | |
creationComplete="creationCompleteHandler();"> | |
<mx:Script> | |
<![CDATA[ | |
import com.jacobheric.youbrew.model.Recipe; | |
import mx.collections.ArrayCollection; | |
import mx.rpc.events.ResultEvent; | |
private function recipe_findByName_resultHandler(event:ResultEvent):void | |
{ | |
recipes = event.result as ArrayCollection | |
} | |
private function search():void | |
{ | |
roRecipe.findByName(searchStr.text); | |
} | |
]]> | |
</mx:Script> | |
<mx:RemoteObject id="roRecipe" destination="recipeService"> | |
<mx:method name="findByName" result="recipe_findByName_resultHandler(event)"/> | |
</mx:RemoteObject> | |
<mx:ApplicationControlBar width="100%"> | |
<mx:TextInput id="searchStr"/> | |
<mx:Button label="Search" click="search()"/> | |
<mx:Button label="New Recipe" click="openRecipe(new Recipe())"/> | |
</mx:ApplicationControlBar> | |
<mx:HDividedBox width="100%" height="100%"> | |
<mx:DataGrid id="dg" dataProvider="{recipes}" width="30%" height="100%" | |
doubleClickEnabled="true" | |
doubleClick="openRecipe(dg.selectedItem as Recipe)"> | |
<mx:columns> | |
<mx:DataGridColumn dataField="name" headerText="Name"/> | |
<mx:DataGridColumn dataField="brewNotes" headerText="Notes"/> | |
</mx:columns> | |
</mx:DataGrid> | |
<mx:TabNavigator id="tn" width="70%" height="100%"/> | |
</mx:HDividedBox> | |
</mx:Application> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment