Results 1 to 4 of 4

Thread: Blank Page showing -- Super Newby Question

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    53

    Default Blank Page showing -- Super Newby Question

    Hi All,

    Could somebody throw me a bone and tell me what is wrong with what I've got here? Nothing is showing up on my browser screen (cell phone) ... BTW; if I comment out the items array I can see the loginPage panel.

    Code:
    new Ext.Application({
    	/*icon: 'icon.png',
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        glossOnIcon: false,
    	*/
    	launch: function() {
    		
    		var logo = new Ext.Panel({
    			html:		'Logo goes here'
    		});
    		
    		var loginForm = new Ext.Panel({
    			items: [
    				{
    					xtype:	'textfield',
    					name:	'username',
    					label:	'username'
    				},
    				{
    					xtype:	'password',
    					name:	'password',
    					label:	'password'
    				}
    			]
    		});
    		
    		var loginButton = new Ext.Button({
    			ui: 	'normal',
    			text:	'Login'
    		});
    		
    		var loginPage = new Ext.Panel({
    			fullscreen:	true,
    			layout:		'vbox',
    			items: 		[logo, loginForm, loginButton]
    		});
    		
    		
    	}
    	
    });

  2. #2
    Touch Premium Member
    Join Date
    Sep 2008
    Location
    Orange County, CA, USA
    Posts
    186

    Default Found it

    Code:
    <script type="text/javascript"> 
        new Ext.Application({
            launch: function() {
                var loginPage = new Ext.Panel({
                    fullscreen:    true,
                    layout:        'vbox',
                    items: [
                        this.logo = new Ext.Panel({
                            html:        'Logo goes here'
                        })
                        ,this.loginForm = new Ext.Panel({
                            items: [{
                                xtype:    'textfield',
                                name:    'username',
                                label:    'username'
                            },{
                                xtype:    'passwordfield', //<---- NOT 'password'
                                name:    'password',
                                label:    'password'
                            }]
                        })
                        ,this.loginButton = new Ext.Button({
                            ui:     'normal',
                            text:    'Login'
                        })
                    ]//eof items
                });
            }
        });
    </script>
    I have pointed out the small error. I removed a bunch of spacing and code I didn't need and I ran the example in chrome with the proper sencha-touch.js and css. It works fine with this change.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    53

    Default

    ah, passordfield, thank you. Interesting that it didn't throw some sort of error, ya know?

  4. #4
    Touch Premium Member
    Join Date
    Sep 2008
    Location
    Orange County, CA, USA
    Posts
    186

    Default xtype

    an xtype string that isn't registered as a valid Ext xtype, is still valid javascript. This is another reason I don't like to use xtypes. new Ext.form.Password() would throw an error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •