-
7 Mar 2012 11:21 AM #1
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...
-
Best Answer Posted by mitchellsimoens
I'm sorry, that actually has no bearing on your problem. Your problem is with the ref which has changed.
Now you should have the getContactForm method that the refs use.Code:config : { refs : { contactForm : '#contactForm' } }
-
7 Mar 2012 11:38 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Mar 2012 11:43 AM #3
-
7 Mar 2012 11:46 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
I'm sorry, that actually has no bearing on your problem. Your problem is with the ref which has changed.
Now you should have the getContactForm method that the refs use.Code:config : { refs : { contactForm : '#contactForm' } }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Mar 2012 12:05 PM #5
great working.....
thanks
but the config won't let me add an array of refs. right??
thanks for the quick reply.......
-
7 Mar 2012 12:10 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
It's an object so if you want another ref add another key:
That will create the getNameOne and getNameTwo methods.Code:refs : { nameOne : 'foo', nameTwo : 'bar' }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Mar 2012 12:15 PM #7
-
3 Oct 2012 5:15 AM #8
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:
and for submission my code is:Code:refs: [ { ref: 'contactForm', selector: '#contactForm' } ],
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.Code:submitContactForm: function() { var form=this.getContactForm(); //this line is giving an error console.log(form); }
-
3 Oct 2012 5:25 AM #9Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
What is calling the submitContactForm method?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Oct 2012 5:50 AM #10
Submit Contact Form Method
Submit Contact Form Method
Code:init: function() { this.control( { 'button[action=submitContact]': { tap: 'submitContactForm' } } ); },


Reply With Quote