[virtualcommons-svn] SF.net SVN: virtualcommons:[383] mentalmodels/trunk/flex/src/custom/ Communica
Status: Beta
Brought to you by:
alllee
From: <kj...@us...> - 2009-12-01 19:06:56
|
Revision: 383 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=383&view=rev Author: kjonas Date: 2009-12-01 19:06:46 +0000 (Tue, 01 Dec 2009) Log Message: ----------- Added messageHandler and faultHandler methods. not sure how to use consumers etc to set this up, so will leave that to Seema. Modified Paths: -------------- mentalmodels/trunk/flex/src/custom/Communication.mxml Modified: mentalmodels/trunk/flex/src/custom/Communication.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/Communication.mxml 2009-12-01 08:54:41 UTC (rev 382) +++ mentalmodels/trunk/flex/src/custom/Communication.mxml 2009-12-01 19:06:46 UTC (rev 383) @@ -3,14 +3,36 @@ <mx:Script> <![CDATA[ + import mx.rpc.events.ResultEvent; + import mx.rpc.events.FaultEvent; import actionscript.Communication; import actionscript.Student; import mx.controls.Label; import mx.controls.Text; + public var student:Student = null; + + public function faultHandler(event:FaultEvent):void + { + // Silent Failure + } + public function messageHandler(event:ResultEvent):void + { + if(event.message.body is actionscript.Communication) + { + commReceived(event.message.body as actionscript.Communication); + } + } + public function btnSend_click():void { - //<service>.<method>(txtMessage.text); + var tempCommunication:actionscript.Communication = new actionscript.Communication(); + tempCommunication.date = new Date(); + tempCommunication.message = txtMessage.text; + tempCommunication.student = this.student; + txtMessage.text = ""; + + //<service>.<method>(tempCommunication); } public function btnSelfComm_click():void { @@ -46,6 +68,10 @@ ]]> </mx:Script> + <mx:RemoteObject id="communicationService" destination="communicationService" fault="faultHandler(event)"> + <mx:method name="sendCommunication" result="resultHandler(event)"/> + </mx:RemoteObject> + <mx:VBox id="vbxMessages" width="500" height="300" verticalScrollPolicy="on"/> <mx:HBox> <mx:TextInput id="txtMessage" width="500"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |