Thanks for the feedback. Find my responses to your questions below. Sent from Yahoo Mail on Android On Tue, 15 Jun 2021 at 22:06, [email protected]<[email protected]> wrote: users Digest 15 Jun 2021 21:06:12 -0000 Issue 1717
Topics (messages 4752 through 4755) Error using js:remoteObject 4752 by: romanisitua.yahoo.com 4753 by: romanisitua.yahoo.com Support for GenericDTO 4754 by: romanisitua.yahoo.com Re: [EXTERNAL] Support for GenericDTO 4755 by: Brian Raymes Administrivia: --------------------------------------------------------------------- To post to the list, e-mail: [email protected] To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] ---------------------------------------------------------------------- I am trying to call my blazeds service from royale.Trying to follow the guidelines specified here https://apache.github.io/royale-docs/features/loading-external-data/remoteobject I get the following error: [onFault] AbstractMessage.readExternalLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultDetail on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultCode on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultString on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property rootCause on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property extendedData on flex.messaging.messages.ErrorMessage Code snippets are as follows trace(" -- registerClassAlias for royale array list -- "); registerClassAlias('org.apache.royale.collections.ArrayList', ArrayList); The above was registered at the main application.mxml. <j:beads> <js:ApplicationDataBinding /> <js:RemoteObject id="service" endPoint = "http://localhost:8080/messagebroker/websocket-amf" destination = "contactService" result="onResult(event)" fault="onFault(event)"/> </j:beads> trace(" about to call contactService.getContacts ... "); service.send("contactService.getContacts", null); private function onResult(param0:ResultEvent):void { trace(" -- onResult oh ! -- "); } private function onFault(param0:FaultEvent):void { trace(" -- onFailure oh ! -- "); var errorMessage : String = param0.message as String; trace(" Error :: " + errorMessage); trace("[onFault]", param0); } I am using jewel. I am tested my blazeds end point using the java amf client. It works fine. This is my first attempt at calling a blazeds end point from royale. Any ideas ? I found the solution. The mistake I made was with the method. I fixed it here service.send("getContacts", []); This source was helpful. https://github.com/apache/royale-asjs/blob/develop/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml Thanks everyone. On Tuesday, June 15, 2021, 12:17:11 PM GMT+1, [email protected] <[email protected]> wrote: I am trying to call my blazeds service from royale.Trying to follow the guidelines specified here https://apache.github.io/royale-docs/features/loading-external-data/remoteobject I get the following error: [onFault] AbstractMessage.readExternalLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultDetail on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultCode on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property faultString on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property rootCause on flex.messaging.messages.ErrorMessageLanguage.as:254 ReferenceError: Error #1056: Cannot create property extendedData on flex.messaging.messages.ErrorMessage Code snippets are as follows trace(" -- registerClassAlias for royale array list -- "); registerClassAlias('org.apache.royale.collections.ArrayList', ArrayList); The above was registered at the main application.mxml. <j:beads> <js:ApplicationDataBinding /> <js:RemoteObject id="service" endPoint = "http://localhost:8080/messagebroker/websocket-amf" destination = "contactService" result="onResult(event)" fault="onFault(event)"/> </j:beads> trace(" about to call contactService.getContacts ... "); service.send("contactService.getContacts", null); private function onResult(param0:ResultEvent):void { trace(" -- onResult oh ! -- "); } private function onFault(param0:FaultEvent):void { trace(" -- onFailure oh ! -- "); var errorMessage : String = param0.message as String; trace(" Error :: " + errorMessage); trace("[onFault]", param0); } I am using jewel. I am tested my blazeds end point using the java amf client. It works fine. This is my first attempt at calling a blazeds end point from royale. Any ideas ? Hi everyone, >From previous royale (flex) docs. I can see that it is possible to bind ui >forms to action script objects (DTO's). i.e actionscirpt classes with public >getter and setter methods. The ORM we are using accepts and returns data as custom generic data transfer objects (GenericDTO). This generic dto is implemented as a hashMap of pojo's (by pojo I mean a java class with public getter and setter methods)) See the example java code snippet below: public class GenericDTO implements Serializable { private static final long serialVersionUID = 1L; private Map<String, Attribute> attributes = null; private String name = null; public GenericDTO(String name) { notNull(name, "The name of the DTO cannot be null..."); this.attributes = new HashMap<String, Attribute>(); this.name = name; } public GenericDTO add(String name, Attribute attribute) { notNull(name, "Attribute name cannot be null"); notNull(attribute, "Attribute with name: " + name + " is null!"); this.attributes.put(name, attribute); return this; } ........ // there are getter/setter method to return the HashMap of Attributes and name field. The attribute class is the base class of all data types. So we have StringType (for String), IntegerType (for Integer) that extend Attribute. Class Attribute public Object getInputValue(); public void setInputValue(final Object object); Is it possible to bind the generic dto to royale ui controls ? e.g. for example I was able to bind an arrayList of ContactDTO successfully. This contactDTO had name and email as fields with public getter and setter methods as follows <j:DataGrid localId="dg1" dataProvider="{contacts}"> <j:columns> <j:DataGridColumn label="Name" dataField="name" columnWidth="200"/> <j:DataGridColumn label="Email" dataField="email" columnWidth="200"/> </j:columns> </j:DataGrid> Assuming it is possible to create ActionScript (as3) versions of GenericDTO, Attribute (with subclasses StringType, IntegerType e.t.c). Implementing the appropriate get and set functions. Is it possible to bind an arrayList of GenericDTO to a royale data grid as follows ? <j:DataGrid localId="dg1" dataProvider="{records}"> <j:columns> <j:DataGridColumn label="Name" dataField="{attributes.name.inputValue}" columnWidth="200"/> <j:DataGridColumn label="Email" dataField="{attributes.email.inputValue}" columnWidth="200"/> </j:columns> </j:DataGrid> i.e. use databinding expressions in the dataField of the data grid ? How about other royale UI controls ? e.g textFields and numberFields in a UI form. Regards, Roman, <!--#yiv4839518074 _filtered {} _filtered {} _filtered {} _filtered {}#yiv4839518074 #yiv4839518074 p.yiv4839518074MsoNormal, #yiv4839518074 li.yiv4839518074MsoNormal, #yiv4839518074 div.yiv4839518074MsoNormal {margin:0in;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv4839518074 span.yiv4839518074EmailStyle18 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv4839518074 .yiv4839518074MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv4839518074 div.yiv4839518074WordSection1 {}--> To understand your problem a bit better, are you saying you’ll have the following? ArrayList full of GenericDTO, each with a map of attributes? Binding the ArrayList of GenericDTO to the dataProvider will then use a single instance of GenericDTO for each row. My response: YES. This is what i want to implement. It almost seems as if you want rows for attributes, not for each GenericDTO? My response: the attribute hashmap that belongs to a generic dto should represent a single row of data in the grid only. You may have to build a new list that contains all attributes you want to render, or look into building/porting the AdvancedDataGrid from Flex. That allows sub-rows (folders) for situations like this. As for dataFields in Royale, you have a couple of options. You generally set dataField to a relative path within the row’s data instance. For example, dataField="someValue"or dataField="someObject.someOtherObject.someValue" in more complex object scenarios. My response: This implies that the generic dto can be accessed based on code the snippet I shared. Kindly confirm ? As you can see, binding isn’t used for dataField. My response: Noted. Thanks. You can also use a custom itemRender to build whatever sub-component you want for each cell. For example, I have Lists/DataContainer where each row can be another List/DataContainer, etc. My response: I am not sure I understand the above scenario you mentioned. Though I will definitely keep this in mind. I just started learning royale. As for all other controls, yes, you can bind directly to their text/value fields. FYI, maps, in my experience, or at least with the tools I’m using, turn into AS3 generic Objects. I’m coming from a Flex source base, being ported to Royale. Maps now exist, and may be usable with deserialization. My response: I intend to create a generic dto in as3. Then create an as3 object to represent the hashmap. This as3 object will use string as "key" to access the "value" from the as3 object. To summarise my question, does this imply that the generic dto can be accessed based on code the snippet I shared. Kindly confirm ? From: [email protected] <[email protected]> Sent: Tuesday, June 15, 2021 1:20 PM To: [email protected] Subject: [EXTERNAL] Support for GenericDTO Hi everyone, >From previous royale (flex) docs. I can see that it is possible to bind ui >forms to action script objects (DTO's). i.e actionscirpt classes with public >getter and setter methods. The ORM we are using accepts and returns data as custom generic data transfer objects (GenericDTO). This generic dto is implemented as a hashMap of pojo's (by pojo I mean a java class with public getter and setter methods)) See the example java code snippet below: public class GenericDTO implements Serializable { private static final long serialVersionUID = 1L; private Map<String, Attribute> attributes = null; private String name = null; public GenericDTO(String name) { notNull(name, "The name of the DTO cannot be null..."); this.attributes = new HashMap<String, Attribute>(); this.name = name; } public GenericDTO add(String name, Attribute attribute) { notNull(name, "Attribute name cannot be null"); notNull(attribute, "Attribute with name: " + name + " is null!"); this.attributes.put(name, attribute); return this; } ........ // there are getter/setter method to return the HashMap of Attributes and name field. The attribute class is the base class of all data types. So we have StringType (for String), IntegerType (for Integer) that extend Attribute. Class Attribute public Object getInputValue(); public void setInputValue(final Object object); Is it possible to bind the generic dto to royale ui controls ? e.g. for example I was able to bind an arrayList of ContactDTO successfully. This contactDTO had name and email as fields with public getter and setter methods as follows <j:DataGrid localId="dg1" dataProvider="{contacts}"> <j:columns> <j:DataGridColumn label="Name" dataField="name" columnWidth="200"/> <j:DataGridColumn label="Email" dataField="email" columnWidth="200"/> </j:columns> </j:DataGrid> Assuming it is possible to create ActionScript (as3) versions of GenericDTO, Attribute (with subclasses StringType, IntegerType e.t.c). Implementing the appropriate get and set functions. Is it possible to bind an arrayList of GenericDTO to a royale data grid as follows ? <j:DataGrid localId="dg1" dataProvider="{records}"> <j:columns> <j:DataGridColumn label="Name" dataField="{attributes.name.inputValue}" columnWidth="200"/> <j:DataGridColumn label="Email" dataField="{attributes.email.inputValue}" columnWidth="200"/> </j:columns> </j:DataGrid> i.e. use databinding expressions in the dataField of the data grid ? How about other royale UI controls ? e.g textFields and numberFields in a UI form. Regards, Roman,
