Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7065807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:00:07+00:00 2026-05-28T05:00:07+00:00

I am trying to create a form through sencha touch that simply takes the

  • 0

I am trying to create a form through sencha touch that simply takes the text that the user enters and does a search for jobs on a website. Although everything else is working properly including the reset button but whenever I do this.getComponent('keywords') in the submitbuttonhandler it gives me an error saying Uncaught

TypeError: Object # has no method ‘getComponent’.
Ext.ns(‘SearchJobsForm’); // register our namespace

var resetButtonHandler = function (btn, evt) {
this.getComponent('keywords').reset();
this.getComponent('dposted').reset();
this.getComponent('jtitle').reset();
this.getComponent('jcategory').reset();
this.getComponent('salaryf').reset();
this.getComponent('salaryt').reset();
this.getComponent('jscategory').reset();
this.getComponent('ptype').reset();
}

Here is the block of code that is the problem. The following block of code is not resolving ‘this’ the way reset button handler above is.

        var submitButtonHandler = function(btn,evt) {
        var temp = this.getComponent('keywords').getValue();
        //query('#jcategory').getValue();
         alert(temp);
        //alert('In Progress');
        }

The following is just creating the form.

        SearchJobsForm.form = Ext.extend(Ext.Panel,{

            initComponent: function(){

                Ext.apply(this, {
                    floating: true,
                    width: 250,
                    height: 370,
                    scroll: 'vertical',
                    centered: true,
                    modal: true,
                    hideOnMaskTap: false,
                    items: [{  
                    xtype: 'textfield',
                    itemId: 'keywords',
                    label: 'Keywords',
                    labelAlign: 'top',
                    labelWidth: '100%',
                    name: 'Keywords'
                    },{  
                    xtype: 'textfield',
                    label: 'Job Title',
                    itemId: 'jtitle',
                    labelAlign: 'top',
                    labelWidth: '100%',
                    name: 'Job Title'
                    },{
                    xtype: 'selectfield',
                    label: 'Job Category',
                     itemId: 'jcategory',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '-- ANY --', value: 'ANY'
                        }, {
                            text: 'Technical', value: 'Technical'
                        }, {
                            text: 'Non-Technical', value: 'Non-Technical'
                        }, {
                            text: 'Tech Start-up', value: 'Tech Start-up'
                        }, {
                            text: 'Life Science', value: 'Life Science'
                        }, {
                            text: 'Digital Media', value: 'Digital Media'
                        }, {
                            text: 'Accelerator Centre', value: 'Accelerator Centre'
                        }
                        ]
                    },{
                    xtype: 'selectfield',
                    label: 'Job Sub-Category',
                     itemId: 'jscategory',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '-- ANY --', value: 'ANY'
                        }, {
                            text: 'Developer', value: 'Developer'
                        }, {
                            text: 'Quality Assurance', value: 'Quality Assurance'
                        }, {
                            text: 'Project Manager', value: 'Project Manager'
                        }, {
                            text: 'Tester', value: 'Tester'
                        }, {
                            text: 'IT Help Desk', value: 'IT Help Desk'
                        }, {
                            text: 'Health Care', value: 'Health Care'
                        }, {
                            text: 'Transportation and Logistics', value: 'Transportation and Logistics'
                        }, {
                            text: 'Management', value: 'Management'
                        }, {
                            text: 'Network', value: 'Network'
                        }, {
                            text: 'Administration', value: 'Administration'
                        }, {
                            text: 'General', value: 'General'
                        }
                        ]
                    },{
                    xtype: 'selectfield',
                    label: 'Position Type',
                     itemId: 'ptype',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '-- ANY --', value: 'ANY'
                        }, {
                            text: 'Part Time', value: 'Part Time'
                        }, {
                            text: 'Part Time Contract', value: 'Part Time Contract'
                        }, {
                            text: 'Full Time', value: 'Full Time'
                        }, {
                            text: 'Full Time Contract', value: 'Full Time Contract'
                        }
                        ]
                    },{
                    xtype: 'selectfield',
                    label: 'Salary (CAD$): From',
                     itemId: 'salaryf',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '-- ANY --', value: 'ANY'
                        }, {
                            text: '20000', value: '20000'
                        }, {
                            text: '30000', value: '30000'
                        }, {
                            text: '40000', value: '40000'
                        },{
                            text: '50000', value: '50000'
                        }, {
                            text: '60000', value: '60000'
                        }, {
                            text: '70000', value: '70000'
                        }, {
                            text: '80000', value: '80000'
                        }, {
                            text: '90000', value: '90000'
                        }, {
                            text: '100000', value: '100000'
                        }, {
                            text: '100000+', value: '100000+'
                        }

                        ]
                    },{
                    xtype: 'selectfield',
                    label: 'to',
                     itemId: 'salaryt',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '-- ANY --', value: 'ANY'
                        }, {
                            text: '20000', value: '20000'
                        }, {
                            text: '30000', value: '30000'
                        }, {
                            text: '40000', value: '40000'
                        },{
                            text: '50000', value: '50000'
                        }, {
                            text: '60000', value: '60000'
                        }, {
                            text: '70000', value: '70000'
                        }, {
                            text: '80000', value: '80000'
                        }, {
                            text: '90000', value: '90000'
                        }, {
                            text: '100000', value: '100000'
                        }, {
                            text: '100000+', value: '100000+'
                        }
                        ]
                    },{
                    xtype: 'selectfield',
                    label: 'Posted in last (Days):',
                     itemId: 'dposted',
                    labelAlign: 'top',
                    labelWidth: '100%',
                        options: [{
                            text: '30', value: '30'
                        }, {
                            text: '60', value: '60'
                        }, {
                            text: '90', value: '90'
                        }
                        ]
                    }
                        ],
                        dockedItems: [{
                                        xtype: 'toolbar',
                                        itemId: 'toolbar',
                                        dock: 'bottom',
                                        height: '36',
                                        items: [
                                                { xtype: 'button', text: 'Reset',itemId: 'reset',scope: this,
                                                handler:  resetButtonHandler  },
                                                { xtype: 'spacer'},
                                                { xtype: 'button', text: 'Submit',
                                                handler: submitButtonHandler 
                                                }
                                                ]
                                    }]


                });


                SearchJobsForm.form.superclass.initComponent.call(this);

               // alert(SearchJobsForm.form.getValues(true));

                this.items.get(2).on({
                    change: this.onChange,
                    scope: this
                });



            },


            onChange: function(selectField, value){
                this.items.get(1).disable();
            } //end of function onChange

        });



        Ext.setup({
            tabletStartupScreen: 'tablet_startup.png',
            phoneStartupScreen: 'phone_startup.png',
            icon: 'icon.png',
            glossOnIcon: false,
            onReady: function(){

                var form = new SearchJobsForm.form();
                form.show();                

            }
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:00:07+00:00Added an answer on May 28, 2026 at 5:00 am

    this.getComponent(childId) browses through the children components of the current object. In resetButtonHandler(), this should be considered as the reset button.

    SearchJobsForm is the declaration of an object not its instance. Otherwise you would have used the “new” command. SearchJobsForm.fieldName doesn’t refers to a field.

    So, in the submitButtonHandler() method’s context, this is equivalent to : Ext.getCmp(‘reset’);

    You can use the id field (not itemId) of the component to address it in a quick and dirty way :

    SearchJobsForm.form = Ext.extend(Ext.Panel,{

    initComponent: function(){
      Ext.apply(this, {
        id: 'form', // add an id to use Ext.getCmp()            
        floating: true,
        ...
      }
    });
    
    // So later you can use 
    Ext.getCmp('keywords') 
    

    Or go all the way up from the resetButton context to the form panel and then down to the input keywords. No need to add an attribute in this case.

    var form = this.el.up('.x-panel');
    var input_keyword = form.down('.x-input-text[name=Keywords]').getValue();
    

    Regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a child form that helps the user to enter data
I'm trying to create a search form that posts the results queried from a
I'm trying to create a php form that for registering the user and store
I am trying to create search form when user search for a course it
I'm trying to create a form that has an expandable widget. The problem is
I am trying to create a form in Rails 2.2.2 that populates a field
I'm trying to create a form that based on the users input would determine
Using C#, I'm trying to create a form with a dataGridView that shows the
I'm trying to create a C# form app that will allow me to use
I'm trying to create a form that will create a table of pricing for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.