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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:wsloginservice="services.wsloginservice.*"
xmlns:loginComponents="components.login.*"
xmlns:views="views.*">
<fx:Declarations>
<s:CallResponder id="loginResult"/>
<wsloginservice:WsLoginService id="wsLoginService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true" result="wsLoginService_resultHandler(event)"/>
</fx:Declarations>
<s:states>
<s:State name="userLoginView"/>
<s:State name="welcomeView"/>
</s:states>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
protected function Valider_clickHandler(event:MouseEvent):void
{
loginResult.token = wsLoginService.login(user_login.text, user_password.text);
}
protected function wsLoginService_resultHandler(event:ResultEvent):void
{
var checkLogin:Boolean = loginResult.lastResult;
if (checkLogin == true) {
this.currentState="welcomeView";
}
else {
this.currentState="";
}
}
]]>
</fx:Script>
<s:Group includeIn="userLoginView">
<loginComponents:BackgroundLogin/>
<loginComponents:LabelPleaseEnterLoginAndPassword x="26" y="86"/>
<s:Group id="UserLoginCenter" x="115" y="236">
<mx:Image id="centerMono" source="web/images/center.png"/>
<s:TextInput id="company_login"/>
<s:Label id="label_user_login" text="Identifiant"/>
<s:TextInput id="user_login"/>
<s:Label id="label_user_password"/>
<s:TextInput id="user_password"/>
<mx:Button id="Valider" click="Valider_clickHandler(event)"/>
<mx:Button id="ButtonPwd"/>
<mx:Button id="ButtonLogin"/>
<mx:Button id="ButtonGetChrome"/>
</s:Group>
</s:Group>
<views:Welcome includeIn="welcomeView"/>
</s:Group> |