<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml" show="initPage()">

<mx:Script source="EmployeeEdit_script.as"/>

<mx:Metadata>
	[Event("save")]
</mx:Metadata>

<mx:Model id="initDto">
	<empno>{null}</empno>
	<ename>{null}</ename>
	<sal>{null}</sal>
</mx:Model>

<mx:Model id="createData">
	<empno>{null}</empno>
	<ename>{null}</ename>
	<sal>{null}</sal>
</mx:Model>

<mx:Model id="editData">
	<empno>7788</empno>
	<ename>SCOTT</ename>
	<sal>1500</sal>
</mx:Model>


<mx:Model id="dto">
	<empno>{empno.text}</empno>
	<ename>{ename.text}</ename>
	<sal>{sal.text}</sal>
</mx:Model>

<mx:Form width="355" height="161">
<mx:FormItem label="従業員番号"><mx:TextInput id="empno" text="{initDto.empno}" restrict="[0-9]"/></mx:FormItem>
<mx:FormItem label="従業員名"><mx:TextInput id="ename" text="{initDto.ename}"/></mx:FormItem>
<mx:FormItem label="給料"><mx:TextInput id="sal" text="{initDto.sal}" restrict="[0-9]"/></mx:FormItem>
</mx:Form>

<mx:ControlBar>
<mx:Button label="更新" click="dispatchEvent({type:'save'})"/>
<mx:Button label="リセット" click="reset()"/>
</mx:ControlBar>
</mx:Panel>