| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:valueObjects="valueObjects.*" |
| xmlns:employeeservice="services.employeeservice.*" |
| title="Add Employee"> |
| <fx:Script> |
| <![CDATA[ |
| import mx.rpc.events.ResultEvent; |
| protected function saveBtn_clickHandler(event:MouseEvent):void |
| { |
| createEmployeeResult.token = employeeService.createEmployee(employee); |
| } |
| protected function createEmployeeResult_resultHandler(event:ResultEvent):void |
| { |
| navigator.replaceView(DetailView,event.result as int); |
| } |
| protected function cancelBtn_clickHandler(event:MouseEvent):void |
| { |
| navigator.popView(); |
| } |
| ]]> |
| </fx:Script> |
| <fx:Declarations> |
| <valueObjects:Employee id="employee"/> |
| <s:CallResponder id="createEmployeeResult" result="createEmployeeResult_resultHandler(event)"/> |
| <employeeservice:EmployeeService id="employeeService"/> |
| </fx:Declarations> |
| <s:Scroller left="0" right="0" top="0" bottom="{saveBtn.height+10}"> |
| <s:VGroup width="100%" gap="10" paddingLeft="15" paddingRight="15"> |
| <s:Label fontWeight="bold" text="First Name" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.firstname}"/> |
| <s:Label fontWeight="bold" text="Last Name" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.lastname}"/> |
| <s:Label fontWeight="bold" text="Title" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.title}"/> |
| <s:Label fontWeight="bold" text="Cell Phone" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.cellphone}"/> |
| <s:Label fontWeight="bold" text="Office Phone" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.officephone}"/> |
| <s:Label fontWeight="bold" text="Email" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.email}"/> |
| <s:Label fontWeight="bold" text="Office" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.office}"/> |
| <s:Label fontWeight="bold" text="Street" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.street}"/> |
| <s:Label fontWeight="bold" text="City" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.city}"/> |
| <s:Label fontWeight="bold" text="State" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.state}"/> |
| <s:Label fontWeight="bold" text="Zipcode" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.zipcode}"/> |
| <s:Label fontWeight="bold" text="Photo File" paddingTop="15"/> |
| <s:TextInput width="100%" text="@{employee.photofile}"/> |
| </s:VGroup> |
| </s:Scroller> |
| <s:Button id="saveBtn" bottom="0" label="Save" horizontalCenter="{-saveBtn.width/2-10}" |
| click="saveBtn_clickHandler(event)"> |
| <s:icon> |
| <s:MultiDPIBitmapSource source160dpi="@Embed('assets/save160.png')" |
| source240dpi="@Embed('assets/save240.png')" |
| source320dpi="@Embed('assets/save320.png')"/> |
| </s:icon> |
| </s:Button> |
| <s:Button id="cancelBtn" label="Cancel" bottom="0" horizontalCenter="{cancelBtn.width/2+10}" |
| click="cancelBtn_clickHandler(event)"> |
| <s:icon> |
| <s:MultiDPIBitmapSource source160dpi="@Embed('assets/cancel160.png')" |
| source240dpi="@Embed('assets/cancel240.png')" |
| source320dpi="@Embed('assets/cancel320.png')"/> |
| </s:icon> |
| </s:Button> |
| </s:View> |
| |