1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Kortrijk, Belgium
    Posts
    16
    Vote Rating
    1
    wuytsr is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    wuytsr is on a distinguished road

      0  

    Default


    Thanks, it works!

Thread Participants: 1

Tags for this Thread