1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    nigel86 is on a distinguished road

      0  

    Default Unanswered: having problems getting ST2.0 running with google app engine

    Unanswered: having problems getting ST2.0 running with google app engine


    I am trying to submit a form to a google app engine java servlet. however, I always got "null" value when i test on servlet parameters as follows. Is the problem related to JSON? can anybody give me some idea? millions ths!

    serlvet console:
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: in PoShiftServlet doPost
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: userid: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: workerid: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: com: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: positionnull
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: podatestart: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: podateend: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: lookfor: null
    2012/4/17 ?? 09:47:26 test.PoShiftServlet doPost
    warning: ps: null
    servlet code:
    Code:
        
    public void doPost(HttpServletRequest req, HttpServletResponse resp)            throws IOException {
            logger.warning("in PoShiftServlet doPost");
            String userid = req.getParameter("userid");
            logger.warning("userid: "+userid);
            String workerid = req.getParameter("workerid");
            logger.warning("workerid: "+workerid);
            String com = req.getParameter("com");
            logger.warning("com: "+com);
            String position = req.getParameter("position");
            logger.warning("position"+position);
            String podatestart = req.getParameter("podatestart");
            logger.warning("podatestart: "+podatestart);
            String podateend = req.getParameter("podateend");
            logger.warning("podateend: "+podateend);
            String lookfor = req.getParameter("lookfor");
            logger.warning("lookfor: "+lookfor);
            String ps = req.getParameter("ps");
            logger.warning("ps: "+ps);
    submit event code:
    Code:
    onposubmitbtntap : function() {
            console.log('onposubmitbtntap');
            var form = this.getPostform();
            var model = form.getRecord();
            model.set(form.getValues());
                    model.save({
                    success : function() {
                        console.log('The model is saved');
                    }
                });
    corresponding model:
    Code:
    Ext.define('BestShift.model.PoShift', {
        extend : 'Ext.data.Model',
        config : {
            fields : [{
                name : 'userid',
                type : 'string'
            }, {
                name : 'workerid',
                type : 'string'
            }, {
                name : 'com',
                type : 'int'
            }, {
                name : 'position',
                type : 'int'
            }, {
                name : 'podatestart',
                type : 'string'
            }, {
                name : 'podateend',
                type : 'string'
            }, {
                name : 'lookfor',
                type : 'string'
            }, {
                name : 'ps',
                type : 'string'
            }],
    
    
            validations : [{
                type : 'presence',
                name : 'userid',
                message : "Enter userid"
            }, {
                type : 'presence',
                name : 'workerid',
                message : "Enter workerid"
            }],
            proxy : {
                type : 'rest',
                url : '/poshift.do'
            }
        },//end-config
    
    
    });
    the input form:
    Code:
    var pouserid = {
                xtype : 'hiddenfield',
                id : 'pouserid',
                name : 'userid',
                //  required: true
            };
    
    
            var poworkerid = {
                xtype : 'textfield',
                id : 'poworkerid',
                label : 'worker id',
                name : 'workerid',
            };
    
    
            var pocom = {
                xtype : 'selectfield',
                id : 'pocom',
                label : 'com',
                name : 'com',
                displayField : 'com',
                valueField : 'com',
                store : Ext.getStore('companies')
            };
    
    
            var poposition = {
                xtype : 'selectfield',
                id : 'poposition',
                label : 'pos',
                name : 'position',
                displayField : 'position',
                valueField : 'position',
                store : Ext.getStore('positions')
            };
    
    
            var podatestart = {
                xtype : 'datepickerfield',
                id : 'podatestart',
                label : 'podatestart',
                name : 'podatestart',
                required : true,
                destroyPickerOnHide : true,
                picker : {
                    yearFrom : new Date().getFullYear(),
                    yearTo : 2020
                },
    
    
            };
    
    
            var podateend = {
                xtype : 'datepickerfield',
                id : 'podateend',
                label : 'podateend',
                name : 'podateend',
                destroyPickerOnHide : true,
                picker : {
                    yearFrom : new Date().getFullYear(),
                    yearTo : 2020
                },
            };
    
    
            var polookfor = {
                xtype : 'selectfield',
                id : 'polookfor',
                label : 'lookfor',
                name : 'lookfor',
                options : [{
                    text : 'a',
                    value : '1'
                }, {
                    text : 'b,
                    value : '2'
                }, {
                    text : 'c',
                    value : '3'
                }, {
                    text : 'd',
                    value : '4'
                }, {
                    text : 'e',
                    value : '4'
                }]
            };
    
    
            var pops = {
                xtype : 'textareafield',
                id : 'pops',
                label : 'ps',
                name : 'ps'
            };
    
    
            var fieldset = {
                xtype : 'fieldset',
                title : 'form',
                items : [pouserid, poworkerid, pocom, poposition, podatestart, podateend, polookfor, pops]
            };
    
            var posubmitbtn = {
                xtype : 'button',
                id : 'posubmitbtn',
                ui : 'action',
                margin : 20,
                text : 'submit',
                handler : this.onposubmitbtntap,
                scope : this
            };
    
            this.add([fieldset, posubmitbtn]);
        },
        onposubmitbtntap : function() {
            console.log('onposubmitbtntap');
            BS.app.fireEvent('onposubmitbtntap', this);
    
        }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    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

      0  

    Default


    You should look at the developer tools and in the network tab you can inspect the request. Does it have the parameters there?
    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.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    nigel86 is on a distinguished road

      0  

    Default


    thank for yr kindly reply....

    the web inspector shows a "200 status code" and there is data embedded in "request payload" as shown in the screen. do u have any idea? i have tried different proxy:rest,ajax,etc..but still got "null" during the req.getParameter()...and
    the req.getParameter() works only if I set directly the submit button with form.submit(url:xxxx) instead of using model-proxy...

    prob.jpg

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    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

      0  

    Default


    Sorry, I don't use the app engine but ST2 is sending the data.
    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.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    nigel86 is on a distinguished road

      0  

    Default


    anyway..thank you so much..mitchellsimoens

    by the way ... is the latest ST2 able to work with the latest sencha io so that i can avoid using app engine? as i remember the current version of sencha io only support ST 1.X...

Thread Participants: 1

Tags for this Thread