Sencha Navigation View

I am using sencha touch 2.3 and PhoneGap for creating an android application, I Have a problem with Navigation View.

main.js

Ext.define('Myapp.view.Main',{  
extend:'Ext.navigation.View',  
xtype:'mainvi,  
requires:['Myapp.view.RedirectView','Myapp.view.IncomingJobView','Myapp.view.MapView','Myapp.view.DriverLoginFormView','Myapp.view.DashboardView','Myapp.view.AccountView'],  
id:'navview',  
fullscreen:true,  
config:{  
items:[{  
    xtype:'RedirectView',  
}],  
navigationBar: {  
        items: [{  
                xtype: 'button',  
                id:'logoutButtonId',  
                hidden:true,  
                text: 'Logout',  
                align: 'right',  
                handler: function(){}  
            }],  
        docked: 'top'  
      }  
   }  
});  

In this project the landing page is RedirectView, Once when I am login then next page is MapView. I used the following code these.

Ext.getCmp('navview').push({  
xtype:'MapView'  
});  

When I Clicked on logout button at that time page redirect to "RedirectView" page. after getting the RedirectView Page I could not going on any another page. The following Warning getting in the console. [WARN][Ext.Component#constructor] Registering a component with a id ('driverLoginTextId') which has already been used. Please ensure the existing component has been destroyed ('Ext.Component#destroy()'.

The Following is my RedirectView.js file

Ext.define('Myapp.view.RedirectView', {
extend : 'Ext.form.Panel',
xtype : 'RedirectView',
requires : ['Ext.Label'],
config : {
    styleHtmlContent : 'true',
    scrollable : 'false',
    //cls:'GreenBackgroundImage',
    style : {
        'background-image' : 'url(resources/images/background.jpg)',
        'background-repeat' : 'no-repeat',
        'background-size' : '100% 100%'
    },
    //title: 'Register',
    layout : {
        type : 'vbox',
        align : 'center',
        pack : 'center'
    },
    items : [{
            xtype : 'panel',

            items : [{
                    xtype : 'button',
                    id : 'RedirectAirportBtnId',
                    text : 'Airport Transfer',
                    width : '200px',
                    height : '35px',
                    style : {
                        'marginBottom' : '10px'
                    },
                }, {
                    xtype : 'button',
                    id : 'RedirectAsDirectedBtnId',
                    text : 'As Directed',
                    width : '200px',
                    height : '35px',
                    //style:{'marginBottom':'10px'},

                }, {
                    layout : 'hbox',
                    xtype : 'panel',
                    flex : 1,
                    items : [{
                            xtype : 'panel',
                            id : 'signinLinkPanelId',
                            width : '100px',
                            items : [{
                                    layout : {
                                        type : 'vbox',
                                        align : 'center',
                                        pack : 'center'
                                    },
                                    items : [{
                                            xtype : 'label',
                                            html : '<a href="#" style="font-size:17px;text-decoration:none;color:#2E3604;text-align:center" onclick=createLoginPage("passengerLoginTextId");><center>Sign in</center></a>',
                                            styleHtmlContent : true
                                        }
                                    ]
                                }
                            ]
                        }, {
                            xtype : 'panel',
                            id : 'takeATourLinkPanelId',
                            flex : 1,
                            items : [{
                                    layout : {
                                        type : 'vbox',
                                        align : 'center',
                                        pack : 'center'
                                    },
                                    items : [{
                                            xtype : 'label',
                                            html : '<a href="#"  style="font-size:17px;text-decoration:none;color:#2E3604">Take a tour</a>',
                                            styleHtmlContent : true
                                        }
                                    ]

                                }
                            ]

                        }
                    ]
                }, {
                    layout : {
                        type : 'vbox',
                        align : 'center',
                        pack : 'center'
                    },
                    items : [{

                            xtype : 'label',
                            id : 'signinAsDriverLinkId',
                            html : '<a href="#" style="font-size:17px;text-decoration:none;color:#2E3604" onclick=createLoginPage("driverLoginTextId");>Login as driver</a>',
                            styleHtmlContent : true,
                            style : {
                                'marginTop' : '-20px'
                            }
                        }, {
                            xtype : 'label',
                            id : 'registerLinkId',
                            html : '<a href="#" style="font-size:17px;text-decoration:none;color:#2E3604" onclick=redirectToRegisterPage();>Register</a>',
                            styleHtmlContent : true,
                            style : {
                                'marginTop' : '-20px'
                            }
                        }
                    ]
                }
            ]
        }
    ]

}

});

Is There Any Kind of mistake for the Redirecting the page? How to destroying the component which is already created in navigationView Array?

Answers


First try to get the view you want push and if not found then create the view with ID

var myMapView = Ext.getCmp('myMapView');
if(!myMapView){
    myMapView  =  Ext.create('Myapp.view.MapView', { id: "myMapView" });
}

Ext.getCmp('navview').push(myMapView);

Need Your Help

Load test raw ssl/tls

performance ssl jmeter performance-testing load-testing

I need to load-test my raw tls server. I try jmeter, but it seems no ssl/tls sampler available(only bundled with http). How can i load - test raw ssl with jmeter? Or maybe there is a better solution?

Is there a simple way to detect collisions between 2 GL objects? e.g glutSolidCylinder & glutSolidTorus

opengl collision-detection

Is there a simple way to detect collisions between 2 GL objects? e.g glutSolidCylinder &amp; glutSolidTorus