xcode does not recognize sencha touch javascript syntax

115 Views Asked by At

i have a weird behavior. i run my sencha touch 2/phonegap 2.0 app on the xcode 4.3

some of my views where not loaded only on the simulator/device. while it loads fine on the browser.

i did not get any special errors in log so i start drop items in the view. finally i discovered that XCODE had problems to recognize some xtypes such as "fieldset", "emailfield", "passwordfield" etc.. after change the "fieldset" to "container" and the fields to "textfield" my view was loaded succesfully. weird ah?

this happen in the following code:

    /*
 * File: app/view/loginformpanel.js
 *
 * This file was generated by Sencha Architect version 2.2.2.
 * http://www.sencha.com/products/architect/
 *
 * This file requires use of the Sencha Touch 2.1.x library, under independent license.
 * License of Sencha Architect does not include license for Sencha Touch 2.1.x. For more
 * details see http://www.sencha.com/license or contact [email protected].
 *
 * This file will be auto-generated each and everytime you save your project.
 *
 * Do NOT hand edit this file.
 */

Ext.define('MyApp.view.loginformpanel', {
    extend: 'Ext.form.Panel',

    config: {
        baseCls: 'fbloginpanel',
        id: 'loginformpanel',
        itemId: 'loginformpanel',
        layout: {
            type: 'vbox'
        },
        scrollable: {
            direction: 'vertical'
        },
        items: [
            {
                xtype: 'container',
                flex: 20,
                cls: 'fblogin',
                layout: {
                    type: 'vbox'
                },
                items: [
                    {
                        xtype: 'container',
                        flex: 3,
                        cls: 'wholepageRelative'
                    },
                    {
                        xtype: 'container',
                        flex: 18,
                        cls: 'wholepageRelative',
                        layout: {
                            type: 'vbox'
                        },
                        items: [
                            {
                                xtype: 'container',
                                flex: 8,
                                docked: 'top',
                                layout: {
                                    type: 'vbox'
                                },
                                items: [
                                    {
                                        xtype: 'fieldset',
                                        flex: 2,
                                        cls: 'loginmargin',
                                        docked: 'top',
                                        title: 'Existing User',
                                        items: [
                                            {
                                                xtype: 'emailfield',
                                                id: 'email1',
                                                itemId: 'email1',
                                                name: 'email1',
                                                placeHolder: 'Email'
                                            },
                                            {
                                                xtype: 'passwordfield',
                                                id: 'password1',
                                                itemId: 'password1',
                                                name: 'password1',
                                                placeHolder: 'Password'
                                            }
                                        ]
                                    },
                                    {
                                        xtype: 'button',
                                        flex: 1,
                                        cls: [
                                            'loginmargin',
                                            'Signbutton'
                                        ],
                                        docked: 'bottom',
                                        id: 'reglogin',
                                        itemId: 'reglogin',
                                        ui: 'round',
                                        icon: '',
                                        scope: this
                                    }
                                ]
                            },
                            {
                                xtype: 'container',
                                flex: 10,
                                layout: {
                                    type: 'vbox'
                                },
                                items: [
                                    {
                                        xtype: 'container',
                                        flex: 10,
                                        layout: {
                                            type: 'vbox'
                                        },
                                        items: [
                                            {
                                                xtype: 'fieldset',
                                                flex: 4,
                                                cls: 'loginmargin',
                                                docked: 'top',
                                                layout: {
                                                    type: 'vbox'
                                                },
                                                title: 'New User',
                                                items: [
                                                    {
                                                        xtype: 'textfield',
                                                        id: 'username',
                                                        itemId: 'username',
                                                        name: 'username',
                                                        placeHolder: 'Username'
                                                    },
                                                    {
                                                        xtype: 'passwordfield',
                                                        id: 'password',
                                                        itemId: 'password',
                                                        name: 'password',
                                                        placeHolder: 'Password'
                                                    },
                                                    {
                                                        xtype: 'emailfield',
                                                        id: 'email',
                                                        itemId: 'email',
                                                        name: 'email',
                                                        placeHolder: 'Email'
                                                    },
                                                    {
                                                        xtype: 'passwordfield',
                                                        hidden: true,
                                                        id: 'hashpassword',
                                                        itemId: 'hashpassword',
                                                        label: 'ססמא',
                                                        name: 'hashpassword'
                                                    },
                                                    {
                                                        xtype: 'numberfield',
                                                        hidden: true,
                                                        label: 'Field',
                                                        name: 'bfacebook'
                                                    },
                                                    {
                                                        xtype: 'numberfield',
                                                        hidden: true,
                                                        label: 'Field',
                                                        name: 'bregister'
                                                    }
                                                ]
                                            },
                                            {
                                                xtype: 'container',
                                                flex: 4,
                                                minHeight: 100,
                                                layout: {
                                                    type: 'vbox'
                                                },
                                                items: [
                                                    {
                                                        xtype: 'button',
                                                        cls: [
                                                            'loginmargin',
                                                            'Regbutton'
                                                        ],
                                                        docked: 'top',
                                                        id: 'regbtn',
                                                        itemId: 'regbtn',
                                                        ui: 'round',
                                                        icon: '',
                                                        scope: this
                                                    },
                                                    {
                                                        xtype: 'button',
                                                        cls: 'fbLoginbtn',
                                                        docked: 'bottom',
                                                        height: '',
                                                        id: 'fbloginbtn1',
                                                        itemId: 'fbloginbtn1',
                                                        ui: ''
                                                    }
                                                ]
                                            },
                                            {
                                                xtype: 'container',
                                                flex: 2,
                                                docked: 'bottom',
                                                height: 50
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                xtype: 'toolbar',
                cls: 'registerToolbar',
                docked: 'top',
                items: [
                    {
                        xtype: 'button',
                        baseCls: 'backbtn',
                        docked: 'left',
                        height: '',
                        id: 'loginbackbtn',
                        itemId: 'loginbackbtn',
                        width: '18%'
                    }
                ]
            }
        ],
        listeners: [
            {
                fn: 'onLoginbackbtnTap',
                event: 'tap',
                delegate: '#loginbackbtn'
            }
        ]
    },

    onLoginbackbtnTap: function(button, e, eOpts) {
        //var Screen = Ext.ComponentQuery.query('#fbloginpanel');

        Ext.Viewport.setActiveItem(Ext.ComponentQuery.query('#fbloginpanel')[0]);
        //Ext.Viewport.show();
    }

});

now i have more problems in the other views, that even do not have those cases.

did some one had similar problems? please help me.

1

There are 1 best solutions below

4
arthurakay On

Just a quick guess, but you aren't using the "requires" keyword in the class you posted.

It's entirely possible that your views fail to load on the simulator or device because the app doesn't know how to resolve those xtypes after a build because the "development" and "production" modes are very different.

As a best practice, always use "requires" for every dependency your class uses.