Mapping existing actionscript class (mx.collections.SortField) to java

Hi,
I would like to map the existing SortField actionscript class on a SortField class on my java backend.
Is it possible to map an actionscript class from standard flex API to a java class? If so, how?
Thanks

Yeah, there is something awry with your mapped classes.  You don't use the java source files to map your classes, you use AS3
classes that are designated to which classes they map to on the backend.  Observe..
package shared.servicevos
   import flash.events.EventDispatcher;
   import flash.events.IEventDispatcher;
   [Bindable]
   [RemoteClass(alias="amf.ShopperVO")]
   public class ShopperVO
       public var shopperId:int;
       public var shopperLocation:String;
       public var shopDate:Date;
       public var shopperAddress:Address
If you notice the the metadata beginning with "RemoteClass", I am telling Flex "when you see an object that comes in with this type "alias" it is should be made into a ShopperVO".  On the backend, I have a folder with a directory structure of /amf and it contains a ShopperVO.java class.
P.S This isn't exactly the setup I am working with cause I am using php, but the ideas are the same.

Similar Messages

  • How to set an actionscript class runnable + some question?

    Dear all,
      i am new to actionscript (Flex 3).
      i am from java camp and i want to achive some java-style functionality in actionscript,and hope you can help me:
      1. how to set an actionscript class runnable??
          in java, i just add a "public static void main(String[] args)" method which will be the program entry point. (IDE, right click the class and click run)
          i can't set a plain, ordinary actionscript runnable in flex builder.
          To test the class, i have to create an mxml (which in turn invoke the testing class) and it be runnable in the flex builder 3.
          any other way to ease the testing?
       2. it there any good 3rd party library for datatype conversion ? (e.g. string <> date, the build-in DateFormatter don't accept milliseconds)...
           it seems actionscript come with limited such kind of utility function
       3. in a custom mxml component, which contains several controls (say testboxes, comboboxes)...etc,
           for information hiding/prevent others to change the child controls in the custom component, how can i hide the child control, not allow
           other code to access the child by  "Component.textbox1"....any scope modifier, e.g. protected, private...etc in mxml?
       thank you.
    ppk luk

    Hi Alex,
      for question 3:
      i just wondering if it is ok or not for better code/validation.....(and it follow the good
    information hiding principle?)
      if i write the component in actionscript only, i can set the child control with scope modifier
    'private' or 'protected'..so that the component user can't just use the dot syntax to gain
    access to the child control,
    e.g. MyComponent.childControlTextInputBox.value = "A";...
    i want to force user to use MyComponent.setInputBoxValue("A")...
    (e.g. in this method, i can do some checking/validate before passing to the textbox)
      this can enforce the data consistency in my custom UI component...
      there is no way to achieve the same effect in MXML?
    (e..g <mx:TextInput id="privateChildControl" accessScope="private" .../>)
      thank you..

  • Flex RPC mapping Java nested classes to ActionScript classes

    We are calling a Java method in our project using
    RemoteObject the value returned by the java method is a ArrayList
    containing instances of a class say ParentClass with some nested
    classes.
    The structure of ParentClass(Java) is something like this
    class ParentClass {
    //some primitives
    private ChildClassA childAInstance;
    private ChildClassB childBInstance;
    //getters setters
    We have created similar class structure on the ActionScript
    side, the ActionScript classes(ParentClass,ChildClassA
    ,ChildClassB) have been properly annotated with the [RemoteClass]
    metadata tag,
    The problem is that though i'm getting the primitive data
    members of the ParentClass through RPC in my corresponding AS
    ParentClass class i'm getting an runtime exception trying to access
    ChildClassA,ChildClassB members.
    Am i missing something, exactly the same scenario is
    mentioned in this article
    http://www.adobe.com/devnet/flex/articles/complex_data.html
    But the Object.registerClass method mentioned in the tutorial
    is giving me compilation error, the sample code attached with the
    article is corrupt zip too.
    Please help me out on this

    JAXB will create classes from an XML schema, SAX is a parser library and JAXP is a library of XML a bunch of XML tools.
    I don't care for JAXB too much. I would skip it and go right to the JAX-RPC spec (WebServices).

  • How to Map Java Beans to appropiate ActionScript class ??

    Hi
    I find it  difficulty in writing a ActionScript class for java Bean.
    Is there any automation  tool avialable which will generate an ActionScript class basing on the java Bean ??
    Thanks in advance .

    I think GraniteDS has a tool for it.

  • Explicity mapping between ActionScript and Java objects for the BlazeDS Messaging Service

    The BlazeDS documentation shows how to explicitly map between ActionScript and Java objects. For example, this works fine for RPC services, e.g.
    import flash.utils.IExternalizable;
    import flash.utils.IDataInput;
    import flash.utils.IDataOutput;
    [Bindable]
    [RemoteClass(alias="javaclass.User")]
    public class User implements IExternalizable {
            public var id : String;
            public var secret : String;
            public function User() {
            public function readExternal(input : IDataInput) : void {
                    id = input.readObject() as String;
            public function writeExternal(output : IDataOutput) : void {
                    output.writeObject(id);
    and
    import java.io.Externalizable;
    import java.io.IOException;
    import java.io.ObjectInput;
    import java.io.ObjectOutput;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.Set;
    public class User implements Externalizable {
        protected String id;
        protected String secret;
        public String getId() {
            return id;
        public void setId(String id) {
            this.id = id;
        public String getSecret() {
            return secret;
        public void setSecret(String secret) {
            this.secret = secret;
        public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {
            id = (String) in.readObject();
        public void writeExternal(ObjectOutput out) throws IOException {
            out.writeObject(id);
    If I called an RPC service that returns a User, the secret is not sent over the wire.  Is it also possible to do this for the messaging service? That is, if I create a custom messaging adapter and use the function below, can I also prevent secret from being sent?
    MessageBroker messageBroker = MessageBroker.getMessageBroker(null);
    AsyncMessage message = new AsyncMessage();
    message.setDestination("MyMessagingService");
    message.setClientId(UUIDUtils.createUUID());
    message.setMessageId(UUIDUtils.createUUID());
    User user = new User();
    user.setId("id");
    user.setSecret("secret");
    message.setBody(user);
    messageBroker.routeMessageToService(message, null);

    Hi Martin. The way that AMF serialization/deserialization works for BlazeDS is the same regardless of which service is being used, so yes that code will work for messaging as well. On the server, the serialization/deserialization of messages happens at the endpoint. For an incoming message for example, the endpoint deserializes the message and then hands it off to the MessageBroker which decides which service/destination to deliver the message to.
    That was a good question. Thanks for asking it. Lots of people are used to doing custom serialization/deserialization with the RPC services (RemoteObject/RemotingService) but I'm not sure everyone realizes they can do this for messaging as well.
    -Alex

  • How to call setter Method of ActionScript class with in a Flex Application

    Hi
    I have Action class as shown :
    public class MyClass
    private var name:String 
    public function get name():String {
        return _initialCount;
    public function set name(name:String):void {
        name = name;
    Now please let me know how can i access this Action class under my Flex Application and call the setter Method of it to set the value for the name .
    For example on entering some data in a TextInput and  click of a submit Button , on to the Event Listener , i want to call the set name method of my ActionScript class .
    Please share your ideas on this .

    Thanks  Gordon for your resonse .
    Say for example my Action class is like this :
    public class MyClass
    private var name:String 
    public function get name():String {
        return name;
    public function set name(name:String):void {
        name = name;
    This is inside the MXML
    I know this way we can do it
    public var myclass:MyClass = new MyClass();
    myclass.name="Kiran";
    Now my query is can we do in this way also ??
    myclass.set name(SomeTextInput.text);
    Please share your views on this , waiting for your replies .
    Thanks in advance .

  • Flex/AS3 Best way to construct a derived class instance from an existing base class instance?

    What is the best way to handle the instantiation of a derived class from an existing base class.
    I have a base class which is being created via remote_object [RemoteClass alias] from the server.   I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.     The base class has meta data that defines what the derived class is, for example
    [RemoteClass (alias="com.myco...')]
    public Class Base
         public var derivedType:String;
         public function Base()
    public Class Derived extends Base
         public "some other data"
         public function Derived()
    In my Cairgorm command which retrieves this object from ther server I want to do this:
    public function result (event: Object):void
        var baseInstance:Base = event.result;
         if (baseInstance.derivedType = "derived")
              var derivedInstance:Derived = new Derived( baseInstance );
    What is the most efficient way of doing this?   It appears to me that doing a deep-copy/clone and instantiation of the derived class is pretty inefficient as far as memory allocation and data movement via the copy.

    Thanks for the assistance.  Let me try to clarify.
    MY UI requires a number of composite classes.    The individual components of the composite classes are being transfered to/from the server at different times depending upone which component has changed state.    The construction of the composite classes from the base class happens in my clients business logic.
    Composition happens in a derived class; but server syncronization happens using the base class.    When I recieve the object from Blazeds through the remote object event, it is in the form of the base class.  I then need to instantiate the derived class and copy the elements of the base class into it (for later composite construction).   And likewise when sending the base class back to the server, I need to upcast the derived class to its base class.   But in this case just a mere upcast does not work.  I actually need to create a new base class and copy the attrbutes into it.  I believe this is limitation of how remoting works on Flex/AS3.
    My question is, what is the best way to turn my base class into it's derived class so further composite construction can take place.   The way I am currently doing it is to create a  load method on the base class, that takes the base class as on argument.  The load function, copies all of the instance attribute references from the base class to the target class.
    public Class Base
         public function Base()
         public function load(fromClass:Base)
        {  //  copy the references for all of the instance attributes from the fromClass to this class }
    Then,  after I recieve the base class from the server.   I create a new derived class and pass the base class into the load function like this:
                for (var i:int=0; i < event.result.length; i++) {
                    var derived:Derived = new Derived();
                    derived.load(event.result[i]);
    The drawbacks of this approach is that it now requires 2 extra instance creations per object serialization.   One on recieving the object from the server and one sending it to the server.    I assume copying references are pretty efficient.  But, there is probably some GC issues.     The worst of it is in code maintenance.   The load function now has to be manually maintained and kept in sync with the server class.
    It would be interesting to hear how others have solved this problem.      The server side is an existing application with around 2M LOC, so changing the code on the server is a non-starter.
    Thanks for your help.

  • Interface Mapping Object - No class definition found

    Hi
    I have created a simple Interface Mapping in the Integration Repo. When i try to TEST the interface mapping i get class not found errors.See the stacktrace below.
    LinkageError at JavaMapping.load(): Could not load class: com/sap/xi/tf/_PO_MAPPING_
      - java.lang.NoClassDefFoundError: Illegal name: com/sap/xi/tf/_PO_MAPPING_
    Looks like some standard sap packages are missing from the CLASSPATH. Anyidea where it has to be specified ?
    PO_MAPPING is the message mapping object i have created and the test is successful for this object.However when i reference it in Interface Mapping , i get the above errors.
    I suppose XI generates Java Code when i create these objects and the mappings.Any idea where the JVM seems to reference these packages and How to rectify it ?
    Thanks
    Saravana

    Hi,
    Please check whether you have applied note 755302.
    - Sreekanth

  • Converting MXML Components to ActionScript Classes

    I'm in the process of converting most (if not all) of my MXML
    components to Action Script classes. I've found this is easy, and
    doesn't require a lot of extra code when extending a simple
    container or control. However, several of my MXML components have
    several nested containers and controls - i.e. a component that
    contains several Labels, a ComboBox, a TextInput, a Button, and a
    DataGrid, plus several other containers needed for layout. To code
    the layout of all these containers and controls using MXML, it uses
    about 16 lines of code. To code the layout in ActionScript, it
    takes about 50+ lines of code (see attached).
    I'm just wondering if there are any best practices for
    creating ActionScript classes that include several (or even A LOT
    OF) containers and controls. It's very easy to layout in MXML, and
    is more visibly pleasing to look at and understand, but I feel it
    is best practice to code components as ActionScript classes. I know
    I should be using MVC, but it's a little late to rewrite the entire
    application now.
    Any thoughts?

    I can't specifically speak to how to write layout code in
    ActionScript, but you can look at the generated code that Flex
    creates to get an idea of how Flex does it. When you compile an
    app, the Flex compiler takes your MXML input and converts it to
    ActionScript classes before compiling the entire set of classes
    into a SWF. Because of this, you can look at the interim
    ActionScript code.
    You do this by setting the keep-generated-actionscript
    compiler option to true and looking in the /generated directory.
    hth,
    matt horn
    flex docs

  • How to reference a Constants.as actionscript in another actionscript class

    Hi,
    How can I use constant variables from a Constatnst file (.as file) in another actionscript class?
    Thanks.

    What id I don't have the Constants.as not defined as a class.
    Constants.as
    public static const BASE_NAME = "ABC";
    public static const EQUIPMENT_NAME = "777";
    I can't import is file as its not a class file, right?
    So, how can I access BASE_NAME, etc.
    In a mxml file, I use the <mx:Script source="/../Constants.as"/>
    but how about in an actionscript class file.

  • Browser not responding when  there is a Exception in ActionScript class

    Hi ,
    I am trying to debug my Application , so under the ActionScript lass i am using some
    trace print messages .
    But the Problem is that when ever there is an Exception on to my ActionScript class , the browser is not responding
    Means i need to manually close the Browser by killing the process itself .
    I guess there is something problem with the FlashPlayer tat is runnning the swf file .
    could anybody please let me know how to resolve this issue .

    When there is an exception, you need to manually close the browser by either clicking on the close button of browser or stop button of the debugger. There is another button in debugger which allows you to ignore the exception and resume execution. It looks like a play button with green color.

  • How to Access MXML components  from ActionScript class

    Hi ,
    I am having a Application Conataner , in which i am having a Form Container with some Label in it .
    This is some thing similar to this as shown :
    <Mx:Application>
    <Mx:Form>
    <Mx:Label text="Hello world"/>
    </Mx:Form>
    </Mx:Application>
    Can any body please let me know how can i access this Form's Label , from an ActionScript class .
    catch(error:*)
    // Here i want to access these Objects and set data to that Label .
    Basically My requirement is that iinside the catch block of my ActionScript class , i want to set some text to the Label , Please
    let me know if this is possible or not also ??
    Waiting for your Replies .

    Hi these both are not same these refer to different one...
    Well let me explain...
    Application.application.myCustomComp.myLabel.text = "sometext"; sets the label "myLabel" which is present inside your customcomponent(which is in main application).
    Application.application.myLabel.text = "sometext"; sets the label "myLabel" which is present directly inside your main application.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Label id="myLabel"  text=""/> // So inorder to set the label(myLabel) present here you will use directly the 2nd line of code.
    <mx:CustomComp id="myCustomComp" /> // So inorder to set the label(myLabel) present inside this component you use 1st line of code.
    </mx:Application>
    Hope now its clear.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Problem in contacting MXML from ActionScript class catch block

    When ever there is a exception inside the ActionScript class , i want to access the MXML TextInputId and dispplay an error Message on to it , but i am unable to succeed.
    This is the code i am using
    <mx:Application>
    <mx:TextInput id="MyTI"/>
    </mx:Application>
    Inside ActionScript class :
    catch(error:Error)
    Application.application.MyTI.text="Error Submitting Data"
    Need your suggestions to implement this .
    Thanks in advance

    Hi Kiran,
    It should defenitely wor for you...
    Try to debug and check whether the control is entering into the catch block.
    Thanks,
    Bhasker Chari

  • ActionScript class being run by mistake in Flex project

    I have a Flex project where my main MXML file is set as the
    one and only application file and is also set as the default file.
    I also have an ActionScript class in the project that extends
    Sprite. It is _not_ set as an Application file.
    When I have the ActionScript class selected, if I hit run or
    debug, FB3 creates a new launch configuration for it and tries to
    run the AS file instead of the default application MXML file.
    Needless to say, this is really annoying as it means I have
    to select the main MXML file before hitting debug/run every time.
    Is this a bug or feature? (Feels like a bug).
    Thanks,
    Aral

    Hi Aral,
    Can you please log it in our public bug system:
    http://bugs.adobe.com/flex?
    It'd be great if you can provide more info to the bug e.g.
    reproducible steps, platform, FB version (Plugin or Standalone).
    thanks,
    Sharon

  • Change of existing assets class description

    Hi Friends,
    I have a query and the details are given below:
    We intend to change the existing assets class description.
    Is it possible!
    What is the impact of such changes?
    As per my observation / opinion, we cannot change the asset class description after configuring the account determination and the other transactions were carried out.
    Is it correct? Can any one advise me pls.
    GB

    Hello
    Asset classes have some default parameters.
    Description can be changed any time.
    This data is at header level and does not impact transactions.
    You should be able to change it.
    See if you can change the description at table level, check Table ANKT or ANKA
    Reg
    Suresh

Maybe you are looking for

  • Error: Document not found. (WWC-46000) while updating a form whit blob items

    Hi all, I have to manage a table-based form. The table has a BLOB field that allows NULL. The blob field of the form is hidden. When I try to INSERT all works well but when I attempt to UPDATE I get "Error: Document not found. (WWC-46000)". Have you

  • About the 64bit coding

    Hi, I have read the guide "Porting 32-bit code to 64-bit code" within the cvi 2009's help. As to the specification, e.g., using 'ssize_t' instead of using 'int', I tried to modify the code : ssize_t authenPanel; //the original define is "int  authenP

  • PO Printing issue

    Hi All, We have a issue when one particular user is printing the PO the Quantity 3 is printing as 2, but when I tried to print it it is printing correct s 3.  When I tried to print at users Printer is printed incorrect. What could be the reason for t

  • Locked in Emergency Mode after Upgrading to 3.0

    I had a pass-code set on my phone before upgrading to 3.0. Now it wants me to connect to itunes. I connect to itunes but it wont sync because I haven't entered the password. My problem is that it does not give me an opportunity to enter the pass-code

  • Burn iPhoto album for pc or mac

    How do I burn an album from Iphoto to disc that will be viewable from either a pc or a mac?