PDA

View Full Version : Blank Page showing -- Super Newby Question



shizny
26 May 2011, 10:22 AM
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.


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]
});


}

});

Jack9
26 May 2011, 12:01 PM
<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.

shizny
26 May 2011, 1:35 PM
ah, passordfield, thank you. Interesting that it didn't throw some sort of error, ya know?

Jack9
30 May 2011, 3:09 PM
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.