Results 1 to 5 of 5

Thread: Uncaught TypeError: Object [object Object] has no method 'getEl'

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
      0  

    Default Answered: Uncaught TypeError: Object [object Object] has no method 'getEl'

    When I execute the below code, i can see an exception in my chrome logged like:

    Uncaught TypeError: Object [object Object] has no method 'getEl'

    Code:
    var search =newExt.form.Panel({
    
        renderTo: 'pan',
        title: 'Basic Panel',
        collapsible:true,
        width: 400,
        defaults: {width: 230},
        defaultType: 'textfield',
        bodyPadding: 10,
        //layout: 'form',
        frame:true,
        items: [{
                fieldLabel: 'Username',
                name: 'username',
                id: 'username',
                allowBlank:false
            },
            {
                fieldLabel: 'Password',
                name: 'password',
               inputType:'password',
                allowBlank:false
            },
    
            {
                fieldLabel: 'First Name',
                name: 'firstname',
               inputType:'text',
                allowBlank:false
            }, 
            {
                fieldLabel: 'Last Name',
                name: 'lastname',
               inputType:'text',
                allowBlank:false
            }
            {
                fieldLabel: 'E-Mail Address',
                name: 'email',
               vtype:'email',
    
               allowBlank:false
            },
    
            {
                fieldLabel: 'State',
                name: 'state',
               allowBlank:false
            },
            {
                fieldLabel: 'City',
                name: 'city',
               allowBlank:false
            }, 
           {
                fieldLabel: 'Country',
                name: 'country',
               allowBlank:false
            }, 
            {
                inputType: 'hidden',
                id: 'submitbutton',
                name: 'myhiddenbutton',
                value: 'hiddenvalue'
            }
    
        ],
        buttons: [{
            text: 'Submit',
            handler: function() {
                search.getForm().getEl().dom.action = 'FormServlet';
                search.getForm().getEl().dom.method = 'POST';
                search.getForm().submit();
            }
    }]


    I have defined the servlet in the web.xml file which contains the name, class and url.
    Please let me know how to resolve this issue.
    Regards,

  2. Ext.form.Basic has no method getEl(). Try to fix your code as below:
    Code:
        buttons: [{
            text: 'Submit',
            handler: function() {
    //          search.getForm().getEl().dom.action = 'FormServlet';
    //          search.getForm().getEl().dom.method = 'POST';
                search.getForm().submit({
                    url: 'FormServlet',
                    method: 'POST'
                });
            }
        }]

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    118
      0  

    Default

    Ext.form.Basic has no method getEl(). Try to fix your code as below:
    Code:
        buttons: [{
            text: 'Submit',
            handler: function() {
    //          search.getForm().getEl().dom.action = 'FormServlet';
    //          search.getForm().getEl().dom.method = 'POST';
                search.getForm().submit({
                    url: 'FormServlet',
                    method: 'POST'
                });
            }
        }]

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
      0  

    Default

    what will be the value for the url? I have given it as the servlet name (i.e. the servlet name present in my web.xml) but it is not working. LoginServlet is the class name present under the package src/com.controller package. The jsp files are present under the web content/jsp folder. Then what will be the value for the url here?

    I am getting an 404 error, it seems to trigger the url : The requested resource (/Demo/jsp/FormServlet) is not available.


  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    118
      0  

    Default

    1. See more information for submit options here: http://docs.sencha.com/ext-js/4-1/#!...ethod-doAction.

    2. Error "The requested resource (/Demo/jsp/FormServlet) is not available" means "/Demo/jsp/FormServlet" Url does not exist.

  6. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
      0  

    Default

    gone through the link suggested.

    when i check the properties of FormServlet.java, i got the path. In the url, i matched the same url with this:
    ../src/com/controller/FormServlet but still it did not worked......Not sure what exactly the url is expecting

Posting Permissions

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