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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  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
  •