1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    22
    Vote Rating
    0
    premkumarsingh is on a distinguished road

      0  

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

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


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

    i am getting this error...
    the code for this is given below...

    Ext.define('sencha.controller.Main',{
    extend: 'Ext.app.Controller',

    views: ['Home','Product','Viewport','Contact'],

    refs: [
    {
    ref: 'contactForm',
    selector: '#contactForm'
    }
    ],


    init: function(){
    console.log('activated');


    this.control({
    'button[action=submitContact]':{
    tap: 'submitContactForm'
    }
    });
    },


    submitContactForm: function(){
    var form = this.getContactForm();
    console.log(form);
    form.submit({
    url: 'contact.php'
    });
    }
    });

    the blue line is giving problem
    thanks...

  2. I'm sorry, that actually has no bearing on your problem. Your problem is with the ref which has changed.

    Code:
    config : {
        refs : {
            contactForm : '#contactForm'
        }
    }
    Now you should have the getContactForm method that the refs use.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    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


    The getter methods that used to be created for each class in the views array are no longer created.
    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
    Jan 2012
    Posts
    22
    Vote Rating
    0
    premkumarsingh is on a distinguished road

      0  

    Default


    then how do i do it.....

    plz help

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    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


    I'm sorry, that actually has no bearing on your problem. Your problem is with the ref which has changed.

    Code:
    config : {
        refs : {
            contactForm : '#contactForm'
        }
    }
    Now you should have the getContactForm method that the refs use.
    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.

  6. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    22
    Vote Rating
    0
    premkumarsingh is on a distinguished road

      0  

    Default


    great working.....
    thanks

    but the config won't let me add an array of refs. right??

    thanks for the quick reply.......

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    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


    It's an object so if you want another ref add another key:

    Code:
    refs : {
        nameOne : 'foo',
        nameTwo : 'bar'
    }
    That will create the getNameOne and getNameTwo methods.
    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.

  8. #7
    Sencha User
    Join Date
    Jan 2012
    Posts
    22
    Vote Rating
    0
    premkumarsingh is on a distinguished road

      0  

    Default


    thanks a lot..

  9. #8
    Sencha User
    Join Date
    Oct 2012
    Location
    Lahore, Pakistan
    Posts
    5
    Vote Rating
    0
    sencha_mir is on a distinguished road

      0  

    Default I still don't understand

    I still don't understand


    I am following the video tutorial which i have downloaded from www.vimeo.com and my code is a carbon copy of the code in the video as i am following it step by step.
    my code for the refs is:
    Code:
    refs:     [
            {
                ref: 'contactForm',
                selector: '#contactForm'
            }
        ],
    and for submission my code is:
    Code:
    submitContactForm: function()    {
            var form=this.getContactForm(); //this line is giving an error
            console.log(form);
        }
    now kindly some one please let me know what i am missing here. It would be well appreciated if you answer by modifying my code.

  10. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    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


    What is calling the submitContactForm method?
    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.

  11. #10
    Sencha User
    Join Date
    Oct 2012
    Location
    Lahore, Pakistan
    Posts
    5
    Vote Rating
    0
    sencha_mir is on a distinguished road

      0  

    Default Submit Contact Form Method

    Submit Contact Form Method


    Code:
    init: function()	{
    		this.control(
    		{
    			'button[action=submitContact]':
    			{
    				tap: 'submitContactForm'
    			}
    		}
    		);
    	},