---
title: "Change view native app Sencha Touch"  
description: "Change view native app Sencha Touch"  
author: "Mark Devid"  
published: 2013-06-03  
updated: 2013-06-03  
canonical: https://www.mindstick.com/forum/973/change-view-native-app-sencha-touch  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 3 minutes  

---

# Change view native app Sencha Touch

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances),\
I created a very [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy) app to test a native [Android app](https://www.mindstick.com/articles/208957/a-complete-guide-for-android-app-development) with [Sencha Touch](https://www.mindstick.com/interview/23004/define-class-system-of-sencha-touch). I have two panels. When a button is tapped in the first panel, the second panel must open. In my [browser](https://www.mindstick.com/blog/155254/which-is-the-best-internet-browser) it works great, but when I create a native [Android application](https://www.mindstick.com/forum/33405/how-to-get-the-build-version-number-of-your-android-application), only the initial view is displayed. When I tap the button the [second view](https://www.mindstick.com/forum/33623/problem-in-moving-value-from-second-view-to-first-view-controller-in-iphone) is not displayed.\
**This is my code:**\

```
Ext.application({views: [    'MyPanel',    'MyPanel1'],controllers: [    'MyController1'],name: 'MyApp',launch: function() {    Ext.create('MyApp.view.MyPanel', {fullscreen: true});} });Ext.define('MyApp.view.MyPanel', {extend: 'Ext.Panel',alias: 'widget.mypanel',config: {    items: [        {            xtype: 'button',            itemId: 'mybutton',            text: 'V1'        }    ],    listeners: [        {            fn: 'onMybuttonTap',            event: 'tap',            delegate: '#mybutton'        }    ]},onMybuttonTap: function(button, e, eOpts) {    this.fireEvent('getPan1');}});Ext.define('MyApp.view.MyPanel1', {extend: 'Ext.Panel',alias: 'widget.mypanel1',config: {    items: [        {            xtype: 'button',            itemId: 'mybutton1',            text: 'V2'        }    ],    listeners: [        {            fn: 'onMybutton1Tap',            event: 'tap',            delegate: '#mybutton1'        }    ]},onMybutton1Tap: function(button, e, eOpts) {    this.fireEvent('getPan');}});Ext.define('MyApp.controller.override.MyController1', {override: 'MyApp.controller.MyController1',config: {    refs: {        myView: 'mypanel',        myView2: 'mypanel1'    },    control: {        myView: {            getPan1: 'getPan1'        },        myView2: {            getPan: 'getPan'        }    }},getPan1: function(){    var a = Ext.create('MyApp.view.MyPanel1', {fullscreen: true});    a.show();},getPan: function(){    var a = Ext.create('MyApp.view.MyPanel', {fullscreen: true});    a.show();}});
```

**\**It seems to me that in the native app the event is not captured in the controller. What am I [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp)?Please help!Thanks in advance. \

## Replies

### Reply by AVADHESH PATEL

Hi Mark,\
Update your line of code from the following\
**The app.js**\

```
Ext.application({views: [    'MyPanel',    'MyPanel1'],controllers: [    'MyController1'],name: 'MyApp',launch: function() {    console.log("appstart");    Ext.create('MyApp.view.MyPanel', {fullscreen: true});}});
```

**\****app/controller/MyController1.js:**\

```
Ext.define('MyApp.controller.override.MyController1', {override: 'MyApp.controller.MyController1',config : {    refs : {        mybutton : 'mypanel button[text="V1"]'    },    control : {        mybutton : {            tap : 'tappedButtonFunction'        }    }},tappedButtonFunction : function(){        console.log("Tapped");        Ext.Msg.alert("Test");        // Do something    }});
```

**\****app/view/MyPanel.js**\

```
Ext.define('MyApp.view.MyPanel', {extend: 'Ext.Panel',alias: 'widget.mypanel',requires: [    'Ext.MessageBox'],config: {    id: 'PanelID',    items: [        {            xtype: 'button',            id: 'mybutton',            text: 'V1'        }    ]}});
```

\
But the controller catched not the event in the native app.


---

Original Source: https://www.mindstick.com/forum/973/change-view-native-app-sencha-touch

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
