You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/09/04 16:27:12 UTC

[1/3] git commit: [flex-asjs] [refs/heads/feature/amf] - get an array of custom value objects

Repository: flex-asjs
Updated Branches:
  refs/heads/feature/amf 8e1b69474 -> 13accbff8


get an array of custom value objects


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/13accbff
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/13accbff
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/13accbff

Branch: refs/heads/feature/amf
Commit: 13accbff82c1f0ea0e0a49f7bcfbcce9fecf38ce
Parents: 92e9b4b
Author: Alex Harui <ah...@apache.org>
Authored: Mon Sep 4 09:26:58 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Sep 4 09:27:07 2017 -0700

----------------------------------------------------------------------
 .../RemoteObjectAMFTest/src/main/flex/App.mxml  | 23 ++++++++++-
 .../main/flex/valueObjects/ClientValueObject.as | 41 ++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13accbff/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
index 974bdd5..116bf8c 100644
--- a/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
+++ b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
@@ -26,6 +26,7 @@ limitations under the License.
 		<![CDATA[
 			import org.apache.flex.net.events.FaultEvent;
 			import org.apache.flex.net.events.ResultEvent;
+            import valueObjects.ClientValueObject;
 			
 			protected function sendName():void
 			{
@@ -35,13 +36,31 @@ limitations under the License.
 			private function onResult(evt:ResultEvent):void
 			{
 				trace("Result=" + evt.data);
-				received.text = "Received: " + evt.data;
+				if (evt.data is String)
+					received.text = "Received: " + evt.data;
+				else
+              	{
+                    var arr:Array = evt.data as Array;
+                    list.dataProvider = arr;
+				}
 			}
 			
 			private function onFault(evt:FaultEvent):void
 			{
 				trace("Fault=" + evt.message);
 			}
+
+			protected function getVOs():void
+			{
+                service.send("getObjectArray1", []);
+			}
+
+            protected function reportChange():void
+            {
+                var vo:ClientValueObject = list.selectedItem as ClientValueObject;
+                received.text = "selected " + vo.id;
+            }
+			
 		]]>
 	</fx:Script>
 
@@ -62,6 +81,8 @@ limitations under the License.
             <js:TextInput id="name_txt" />
             <js:TextButton text="Send Name to AMF" click="sendName()"/>
 			<js:Label id="received" width="300"/>
+            <js:TextButton text="Get Array of ValueObjects" click="getVOs()"/>
+            <js:List id="list" labelField="id" width="100" height="100" change="reportChange()"/>
         </js:View>
     </js:initialView>
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13accbff/examples/flexjs/RemoteObjectAMFTest/src/main/flex/valueObjects/ClientValueObject.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/src/main/flex/valueObjects/ClientValueObject.as b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/valueObjects/ClientValueObject.as
new file mode 100644
index 0000000..e328ca2
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/valueObjects/ClientValueObject.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package valueObjects
+{
+    [RemoteClass(alias="org.apache.flex.amfsamples.valueobjects.ServerCustomType")]
+	public class ClientValueObject
+	{
+		public function ClientValueObject()
+		{
+		}
+
+		private var _id:String;
+
+        public function get id():String
+        {
+            return _id;
+        }
+        
+        public function set id(value:String):void
+        {
+            _id = value;
+        }
+
+	}
+}


[3/3] git commit: [flex-asjs] [refs/heads/feature/amf] - didn't get its flexjs_wrapper set. SimpleList seems to be extending List which doesn't seem right to me though

Posted by ah...@apache.org.
didn't get its flexjs_wrapper set.  SimpleList seems to be extending List which doesn't seem right to me though


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f3dd4614
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f3dd4614
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f3dd4614

Branch: refs/heads/feature/amf
Commit: f3dd4614f65fd0816f75c960b00151ea34b58272
Parents: 8e1b694
Author: Alex Harui <ah...@apache.org>
Authored: Mon Sep 4 09:26:03 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Sep 4 09:27:07 2017 -0700

----------------------------------------------------------------------
 .../projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f3dd4614/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as
index 0d254e5..b71b7cd 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/SimpleList.as
@@ -58,6 +58,7 @@ package org.apache.flex.html
         override protected function createElement():WrappedHTMLElement
         {
             element = document.createElement('select') as WrappedHTMLElement;
+            element.flexjs_wrapper = this;
             (element as HTMLSelectElement).size = 5;
             goog.events.listen(element, 'change',
                 changeHandler);


[2/3] git commit: [flex-asjs] [refs/heads/feature/amf] - on SWF, we don't get an AcknowledgeMessage?

Posted by ah...@apache.org.
on SWF, we don't get an AcknowledgeMessage?


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/92e9b4b4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/92e9b4b4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/92e9b4b4

Branch: refs/heads/feature/amf
Commit: 92e9b4b474686cd7ba928cbc8803f8b43e0e0f8e
Parents: f3dd461
Author: Alex Harui <ah...@apache.org>
Authored: Mon Sep 4 09:26:31 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Sep 4 09:27:07 2017 -0700

----------------------------------------------------------------------
 .../org/apache/flex/net/remoting/Operation.as     | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e9b4b4/frameworks/projects/Network/src/main/flex/org/apache/flex/net/remoting/Operation.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/remoting/Operation.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/remoting/Operation.as
index 989db30..fc830d2 100755
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/remoting/Operation.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/remoting/Operation.as
@@ -53,7 +53,7 @@ package org.apache.flex.net.remoting
 		
         private function destinationResultHandler(param:Object):void
         {
-            if (param is AcknowledgeMessage) // this force links AcknowledgeMessage so it deserializes correctly in JS
+            COMPILE::SWF
             {
                 var message:RemotingMessage = new RemotingMessage();
                 message.operation = _name;
@@ -62,8 +62,20 @@ package org.apache.flex.net.remoting
                 message.destination = _ro.destination;
                 _ro.nc.call(null, new Responder(_ro.resultHandler, _ro.faultHandler), message);
             }
-            else
-                trace("destination result handler", param);            
+            COMPILE::JS
+            {
+                if (param is AcknowledgeMessage) // this force links AcknowledgeMessage so it deserializes correctly in JS
+                {
+                    var message:RemotingMessage = new RemotingMessage();
+                    message.operation = _name;
+                    message.body = _args;
+                    message.source = _ro.source;
+                    message.destination = _ro.destination;
+                    _ro.nc.call(null, new Responder(_ro.resultHandler, _ro.faultHandler), message);
+                }
+                else
+                    trace("destination result handler", param);
+            }
         }
             
         private function destinationFaultHandler(param:Object):void