Results 1 to 3 of 3

Thread: How to pass data from a view to a model.

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Kortrijk, Belgium
    Posts
    16
    Vote Rating
    1
      0  

    Default Answered: How to pass data from a view to a model.

    Hi,

    How can I pass the value of 1 txtfield and 1 passwordfield to my Model. I need those values to put in a url. (Sap Gateway)

    These are the relevant pieces of my code:

    Login.js (view)
    Code:
     var txtuser = {            
                xtype: 'textfield',
                label: 'User:',
                value: user,
                style: {
                    'font-family': "Tahoma",
                    "font-size": "24px"
                },
                name: 'field',
                width: "60%",
                margin: "0 0 0 40",
            };
            
            var txtpassword = {
                xtype: 'passwordfield',
                label: 'Password:',
                value: pwd,
                style: {
                    'font-family': "Tahoma",
                    "font-size": "24px"  
                },
                name: 'password-',
                width: "60%",
                margin: "20 20 20 40",
                
    
            };


    Activity.js (model)

    Code:
            proxy: {           
                // use the special sap_gateway proxy
                type: 'sap_gateway',
                url: "http://scvwis0046.dcsc.be:8010/sap/opu/odata/sap/Z_GW_WORKITEMS_CM_WR/z_gw_workitems_wrCollection?sap-user=" + username + "&sap-password=" + password
            }

    Thanks

  2. You won't be able to do it like that, that's just JavaScript saying you can't do that. You would have to set the url on the proxy using the setUrl method on the proxy.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      1  

    Default

    You won't be able to do it like that, that's just JavaScript saying you can't do that. You would have to set the url on the proxy using the setUrl method on the proxy.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Location
    Kortrijk, Belgium
    Posts
    16
    Vote Rating
    1
      0  

    Default

    Thanks, it works!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •