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

  • Home
  • SEARCH
  • 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 7909365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:22:59+00:00 2026-06-03T12:22:59+00:00

I have added a button as shown in the code below, I have added

  • 0

I have added a button as shown in the code below, I have added id:'submitBtn' so when this button is clicked the controller class MyController will get called and execute.

1.) How does the code know that it should go execute the Controller class ?

{
                   xtype:'button',
                   {
                   xtype:'button',
                   id:'submitBtn',
                   text:'Send',
                   ui:'confirm',
                   padding:5
                   text:'Send',
                   ui:'confirm',
                   padding:5
}

To check if everything is working i checked if the Controller class is getting called; Here’s the code;

MyController.js

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

       config: {
       refs : {
       submitBtn: '#submitBtn'
       },

       controls : {
       submitBtn: {
       onTap: 'submitData'
       }
       },
       },

       submitData: function() {
       var form = Ext.getCmp('form-id');
       alert("Came here!");

       var formvalues = form.getValues();

       // Web Service code goes here ..
       Ext.Ajax.request({
                        params: formvalues,                     
                        url:'http://mywebservice.com/web_ser'

                        success : function() {
                        Ext.Msg.alert('Success');
                        }

       }
       });

But, the alert was not displayed. I think the controller class was not called.

In the app.js class i have added the controller as shown below;

views: ['Main','Home', 'Contact'],
    controller:['MyController'],

Help ?

  • 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-06-03T12:23:00+00:00Added an answer on June 3, 2026 at 12:23 pm

    In MyController.js,

    Change

    1. controls: to control: and
    2. onTap : to tap :

    & it should work now.

    How does the code know that it should go execute the Controller class
    ?

    Check out the documentation of controller for neat & complete explanation

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

Sidebar

Related Questions

I have a button that when pressed, a tableview section will be added and
i have this code below to show different divs when i choose certain radio
I have added a Button in the View { xtype:'button', id:'when_button_click', text:'Button Click', ui:'alert'
I have coded my calculator in simple mode, I have added a button for
I have a Repeater with a Button inside the ItemTemplate . I added the
I have created a asp.net website and i added tooltip to a button by
I have a page with some dynamically added buttons. If you click a button
I have added a controller to my project named UserManager (automatically generated from the
The javascript code is attached below. Two push pins are added to a Bing
The code below works as follows: a form is shown with a list of

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.