Mapping action script object to mx:model object

Hi all,
I am having an action script class and an mx:model element
with same elements. I want to assign an action script object to
this mx:model. How can I do that one?
Let me state it clearly.
Say, my action script class contains two elements - user and
rollno with required getter and setter methods.
And I am having an mx:model element with the following
format.
<mx:model id="data">
<data>
<user/>
<rollno/>
</data>
</mx:model>
I want to assign an instance of action script class to this
model object.
I tried extending action action script class from Objectproxy
and used data=actionscriptinstance.
But it's not working properly.
Is there anyway I can do this one?
Thanks in advance

The quick answer:
<mx:model id="data">
<data>
<user>{ myASObj.user }</user>
<rollno>{ myASObj.rollNo}</rollno>
</data>
</mx:model>
The bigger question might be, "Why have the mx:Model?"
The Model tag is all Strings, so you lose data typing.
Why not just create a value object (VO) for your user data
and pass that around?
package samples.user {
[Bindable]
[RemoteClass(alias="samples.user.User")]
public class User {
public var user:String;
public var rollNo:int;
Then when the result data returns, cast to the VO.
public var user:User = (eventObj.result as User)

Similar Messages

  • Model object is not getting executed

    hi,
       I have created a model and iam getting values from back end using RFC.The values are not retrieved in front end and found that my model object is not getting executed.how to rectify this problem.please help me out.
                                                                                    regards
                                                                                    Sharanya.R

    Hi,
    Please psot your code for analysing, and also check whether it conforms to following coding:
    // Create a new instance of the Bapi_Flight_Getlist_Input model object
    bapiInput =Bapi_Flight_Getlist_Input();
    // Create the structured input parameters required for this RFM
    Bapisfldst destTo = new Bapisfldst();
    Bapi_Flight_Getlist_Input bapiInput;
    Bapisfldst destFrom = new Bapisfldst();
    // Add the DESTINATION_TO and DESTINATION_FROM parameter objects to the
    // model object representing the input side of the BAPI interface
    bapiInput.setDestination_To(destTo);
    bapiInput.setDestination_From(destFrom);
    // Bind the model object instance to context model node
    wdContext.nodeBapi_Flight_Getlist_Input().bind(bapiInput);
    bapiInput.execute();
    // If the execution is successful, then invalidate
    // the corresponding output node
    wdContext.nodeOutput().invalidate();

  • Action script object

    I would like to creare an object for third party developers
    to report high score.
    I dont want them to see my code.
    So for example I will create a class highScore with API
    sendScore and the developer will use it.
    What is the best way to do it?
    Is the only way to do it is to crearre action script file
    that they can see my code?

    Well, a good place to start:
    http://www.adobe.com/devnet/flash/components/components.html

  • Ho to change the mapped System object to the Model to another System object

    Hi All,
    Initially i have created one system object (TestSystemForVC) for testing the VC application. Then i have started completing the whole development in that perticular model object. many data soruce objects are added to the model using the TestSystemForVC system object.
    Now i have created one more system object pointing to Otherclient. in R3. How make use of the same model pointing this new System object for working properly with out doing the complete development of that model.
    I just want to map the existing model to new system object. Can any body tell me how to achieve this.
    Regards
    Vijay

    Hi Vijay,
    therefore you can use the Alias Manager (see attachment). There you can replace all other system aliases.
    Best Regards,
    Marcel

  • Action script objects not displayed

    Hi,
    I am creating an air application using Flex 4.5 compiler. The problem i am facing currently is that i have extended shape class to my custom class movingObject. in this class i have defined a function "drawcircleObj" in this class and calling this class function to display my customized circle on the stage.
    But it is not behaving as desired. i.e. no object is being displayed

    Adding my code snippets
    The as file code
    package secondPackage
        import flash.display.*;
        public class movingObject extends Shape
            private var xPos:Number;
            private var yPos:Number;
            private var radius:Number;
            private var color:uint;
            public function movingObject()
            {// currently a stub will use it later
            public function drawcircleObj(xInput:Number,
                                          yInput:Number,
                                          radInput:Number,
                                          colorInput:uint): void
                xPos = xInput;
                yPos = yInput;
                radius = radInput;
                color = colorInput ;
                this.graphics.beginFill(color);
                this.graphics.drawCircle(xPos,yPos,radius);
    The mxml file code
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           creationComplete="initApp()">
        <fx:Script>
            <![CDATA[
                import secondPackage.movingObject;
                import flash.display.*;
                private var myMoving:movingObject = new movingObject();
                public function initApp():void
                    //show the string
                    myMoving.drawcircleObj(500,500,30,0xFF0000);
                    mainText.text = myMoving.letsStart();
            ]]>
        </fx:Script>
        <s:TextArea id="mainText" x="390" width="50" y="133"/>
        <s:Button  id="button1" x="804" y="227" label="Button" width="45"/>
    </s:WindowedApplication>
    The problem which i suspect is that there should be a stage object holding the same object or circle created and then display it.
    A faster reply will be highly appreciated. Thank you.

  • How do I Action Script buttons, so the objects lay on the prior object clicked on, in Flash?

    Here's my idea but having problems with the actions scripting:
    Accessories and build your car application in Flash.
    I'm new to the Action Script 3 and I am trying to Action Script my custom graphics for a “build your own car”. Something similar to the Harley Davidson motorcycle builder https://www.harley-davidson.com/en_US/Content/Pages/H-D1/Bike-Builder.html#/locale__en_US/ model__FLD/year__2013
    I have all the graphics (multiple photos, photoshopped and cut out for the different car body colors. I'm doing the same with the car rim choices, etc) All the graphics are sized so they will lay on top of one another seamlessly but I don't know how to Action Script 3 the buttons so you can click on (ex: rim1, or rim2 , etc and see how it looks on car by pulling up the photo on top of the existing background car photo) .
    How would I Action Scrip my "color button" to come up with 10 color swatches I’ve designed and then when you click on the color swatch (ex: red). It will then put the graphic red of the car body that I have already made on top of the existing background photo of the car and so on for each color button?
    Thanks for the help in advance!

    I'm not sure if I do know how to correctly create the Wheels classes and use action scripting. Are the classes you're referring to the parts I labeled btn1, btn2 below? Here's what I have under the main Timeline labeled actions:
    stop() ;
    // Color button code //
    colorbtn.addEventListener(MouseEvent.CLICK, btn1);
    function btn1 (event:MouseEvent) :void{
        gotoAndStop (2);
    // Rims button code //
    rimsbtn.addEventListener(MouseEvent.CLICK, btn2);
    function btn2 (event:MouseEvent) :void{
        gotoAndStop (3);
    //rim1 button code //
    rim1.addEventListener(MouseEvent.CLICK, btn3);
    function btn3 (event:MouseEvent) :void{
        gotoAndStop (4);
    I'm not sure how to fit your code in that you said in your first comment. The //rim1 button code // doesn't currently work.
    I think if I had a sequence of the action script 3 with a button/movie clip layed out for me, I could organize accordingly for my buttons and movie clips. Since they would work the same just would have to have different labels.

  • Flex with any ORM - Writing Model classes and action scripts redundant?

    Hi,
    I am using Hibernate with Flex. I have all my model classes
    as POJOs. Now if i have to access these POJOs directly from flex, I
    need to write action script reference classes for all my POJO model
    classes. Since mapping POJOs with action script reference classes
    is so mechanical, i am wondering if there is any tool to read all
    the properties from the POJO's and convert them to action script
    reference classes automatically. Is there any way that this can be
    automated?
    Thanks in advance.
    Chandu.

    If you use Granite Data Services, there's something called
    "gas3" (I think is the name). You may be able to use it even if you
    don't use Granite.
    I didn't care for learning how to use it (plus it uses
    Groovy, more needless stuff to learn I guess), so I can't say how
    well it works. I just wanted a simple custom ant task that
    generates ActionScript classes for my Java classes. So I ended up
    making my own. It's definitely not trivial but it's not that hard
    if you're very good with Java and reflection.

  • Is it recommended to instantiate Model object from Backing Bean

    Wondering what are the best practices in developing JSF,Spring, Hibernate application.
    Appfuse/Equinox example instantiate Model Object i.e. POJO in the Backing bean. Here is the snippet
    UserForm.java (Backing Bean)
    public class UserForm {
    public User user = new User();
    public UserManager mgr;
    // Getter & Setter methods for user & mgr
    //Persistence
    public String save() {
    mgr.saveUser(getUser());
    addMessage("user.saved", getUser().getFullName());
    return "success";
    I undertand the purpose of having UserManager defined in backing bean but wondering why do we need to have Model (i.e. User) defined in backing bean . Is this a best practice?
    Is it recommended to populate model object with data in the backing bean and then call for business methods like mgr.saveUser(getUser());
    Regards
    Bansi

    Here is some more info
    UserForm is a JSF managed bean,
    User is a hibernate mapped POJO, and
    UserManager is manager class in Spring
    I am wondering about perfomance issues i.e. making DB calls from backing bean getters or setters. DB calls can mean a performance hit, and JSF will call the getters and setters multiple times per page request (which means you'll be doing multiple DB calls).

  • Can i Bind more than one Model object to the Custom controller or not

    Hi All, I trying to bind more than one model object to the custom controller, Both the model objects contains same attribute name called ( output). Both model objects created on to top of the BAPI. So when i bind first model object to the custom controller will work fine. When i am trying to bind the second model object to the same controller. This second model object also having the same attribute name called "output" . So it is giving an error of "Duplicate context element "Detail". Rename or uncheck duplicate elements.
    can i assign more than one model object to the single controller or not?
    But in the reference document, it has given that , we can create model object with more than one bapi.So in this case if both the bapis contains any element with the same name will also be problem. Any body give me the solution.
    Initially we have created one custom controller for each model object. But later i realized that, why con't we use same controller for all the model object. Because, the custom controller context is the public context. this context shared across all the view controllers.
    The concept which I am trying to do is right or wrong?

    Hi Vishal,
    of course, you can bind one controler to many models. When the same name occours you can simply RENAME binded node in controler.
    Regards
    Bogdan

  • How to generate the DDL script of all the schema objects.

    Hi All,
    I just wanted to make centralized repository for Oracle database and to create a base version, I need to create the DDL scripts of all the database objects so that i can check in the same ddl scripts (sql) files in to my central repository.
    I need do this schedule job which will generate the ddl scripts once in a month(This should be automated process)
    Please help me out about this.
    Oracle version - 9i
    Thanks in advance.
    Thanks,
    Santosh
    Edited by: Santosh_Oracle on Feb 23, 2011 10:26 PM

    It is definitely possible to revise the script.
    Look at it, you already have 80 percent of it for free, and you didn't even need to Google.
    Just ask a FAQ in a forum loaded with FAQs!
    And Toad can save everything to one script per object.
    Sybrand Bakker
    Senior Oracle DBA

  • The requested action is not supported for this object. [message 131-171]

    Hi,
    One user is having the below error message appear when she attempts to print remittances. This has only started happening since yesterday and all other documents are still printing.
    "The requested action is not supported for this object. [message 131-171]"
    Any ideas what could be the problem?
    Regards,
    Mohan

    Hi Johnson,
    I have not tried your suggestion till now as I am waiting for the database copy from my client.
    Just a quick question, As I already mentioned earlier and I also keep getting the issues from the users reporting that the user's get this error only if they print 'remittance advise reports' has multiple invoices.
    The report prints fine if it has single invoice even if it is a check payment.
    Will your suggestions address this as well?
    Regards,
    Mohan

  • Model Instance Vs Model Object

    Hi experts
    can anyone plz explain me the difference between model instance and model objects. is it necessary to create model instance when dealing with WebService model.
    also tell me what do u mean by associating model objects.
    plz explain with reference to the following code :
    <b>public void wdDoInit() {
    //@@begin wdDoInit()
    // create a new model instance (1)
    model = new EmailAdWSModel();
    // create model objects (2, 3)
    Request_SendEmail requestMO = new Request_SendEmail(model);
    SendEmail emailMO = new SendEmail(model);
    // associate model objects (4)
    requestMO.setSendEmail(emailMO);
    // bind executable model object to context node (5)
    wdContext.nodeRequest_SendEmail().bind(requestMO);
    //@@end
    }</b>
    i found this on sample exercises given on sdn:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/301ff0bb-74ca-2910-fa99-eae392695aad
    can any one help me regarding this.
    Thanks in advance.

    Hi krishnan..,
                       To be brief , have a clear idea about model i.e., A model contains number of classes inbuilt in it which u could find after importing a model..
    You must create an instance to the model to access the classes in the model..
    similarly you create objects to the classes in the model to get it referenced..
    As u are used to object oriented programming, i hope u may have a good idea about classes and objects..
    An object is always an instance of a class..and u can never access a class without creating an object to the class..
    as in the coding which u have given..
    "model" is an instance of the model called EmailAdWSModel();
    then u create objects for the classes inside the model and then u access the attributes by referencing the objects of the class.
    hope u would be clear with this concept

  • How to close a model object connection for Adaptive RFC?

    Hi,
    I'm calling two update RFC one after another in a single WebDynpro program. I like to close the session/connection after calling the first RFC. I'm using twp separate JCo connection for calling these two RFCs. Still I find both the RFCs are called in the same session.
    Is there any way to close the JCo session from the code?
    Thanks ,
    Dipankar

    Hi Dipankar
    If you want the framework to control the opening and closing of the connections , then use TASK_SCOPE when initializing the modelobjects ,in which case the connection will remain open, for the lifecycle of a single call.
    The intialization should be as below
    (CompanyCodeList is your model object)
    CompanyCodeList compCode = (CompanyCodeList)WDModelFactory.getModelInstance(CompanyCodeList.class, WDModelScopeType.TASK_SCOPE);
    Bapi_Companycode_Getlist_Input bapIn = (Bapi_Companycode_Getlist_Input) compCode.createModelObject(Bapi_Companycode_Getlist_Input.class);
    wdContext.nodeBapi_Companycode_Getlist_Input().bind(new Bapi_Companycode_Getlist_Input());
    Regards
    Pran

  • Model object not gettting updated with mergeWithReferences()

    I have a model object A that contains list of other models b as a collection.
    I want to update object A using getTopLinkTemplate().mergeWithReferences(a) but it is not updating object a values in the database. The changes seems to be in the cache but when I check db, no changes at all.
    Following debug statements clearly tells that UOW started but didn't run update SQL statement.
    DEBUG [oracle.toplink.transaction] UnitOfWork(30070212)--begin unit of work commit
    DEBUG [oracle.toplink.transaction] UnitOfWork(30070212)--end unit of work commit
    DEBUG [oracle.toplink.transaction] UnitOfWork(30070212)--release unit of work
    DEBUG [oracle.toplink.transaction] UnitOfWork(30070212)--release unit of work
    Please help me update an object.
    BTW, I am first pulling the model object for update, set new values in the model object and then try to merge but in vain.
    Kindly help.
    Zealous
    Edited by: zealous on May 9, 2011 5:19 AM

    Hello,
    How are you reading in A, and what are you changing? Be sure that you read in A using a uow otherwise you might be changing the object in the cache - if you are changing the cache object, merge will be a no-op and nothing will have appeared to change. If you are modifying 1:m relationships, make sure that both sides are changed as the side that owns the foreign key controls the field in the database. If you are removing B's from the A, you will probably need to merge these Bs seperately, as any changes made to them will not get picked up since the merge will not be able to cascade to them once they are dereferenced.
    Best Regards,
    Chris

  • Extend Object in Org model to add Business Role

    Hi All,
    How can I extend Object in Org model to add Business Role(e.g Sales Manager)?
    Thanks

    Hi Ashley,
    If you right click on org unit select create option.
    Select position & create the position you want to create.
    You can transport the org unites & positions thru SE38.
    Use programme RHMOVE30
    Select
    Plan version                    01  Current plan
    Object type                     O   Organizational unit ( S fopr positions)
    Select "tanport object" fo Transport screen.
    You will be able to create the request.
    Trust it clarifies doubt.
    Reward if useful.
    Thanks,
    Rahul

Maybe you are looking for

  • How do I change the phone number linked to one of my contacts?

    We want to FaceTime my mother in law but under her contact her work number is listed as the FaceTime phone number. I need to change that to either her mobile or her email address. How do I do that?

  • Subreport preview issue differences between VS 2008 and VS 2012

    I have a report that contains a subreport which source is a report already deployed on the report server.  In VS 2008, when you do a preview the data in the main report displays fine and you get an error on the subreport.  In VS 2012, when you try an

  • ITunes 7.5 - cannot purchase anything

    Hi, I am having issues trying to make a purchase from the iTunes store for the last 48 hours. I can access my account ok online and review my personal info, but cannot make a purchase. i get a message that states that there is a problem with the iTun

  • EQ'ing different sections of a Track

    I am somewhat new, but proficient at Logic. What I want to do is take only a certain section of a single track, and just apply the EQ to only that small section (i.e. a different vocal EQ at a verse or bridge). Help me out, guys. Thanks -Laurie

  • Error code -50 when attempting to copy to G-drive

    I have a new G-Drive 4T bytes.  It works fine most of the time, but if let inactive for a few hours and I try to write to it in any way I get the message: The operation can't be completed because of an unexpected error occurred (error code -50).  Any