PDA

View Full Version : PhoneGap Tutorial and iPad



StayArrr
5 Feb 2011, 8:27 AM
Hi all,

I am new to Sencha Touch, but fall in love a little bit ;)
I followed the tutorial provided here: http://www.sencha.com/learn/Tutorial:A_Sencha_Touch_MVC_application_with_PhoneGap

All works well on simulator with device iPhone - but if I change the device to iPad I do not get alerts and there is no Viewport loaded. For what I mean:


Ext.regApplication
({
name: 'app',
launch: function() {
this.launched = true;
this.mainLaunch();
},
mainLaunch: function() {
if (!device || !this.launched) {return;}
console.log('main launched');
this.views.viewport = new this.views.Viewport();
}
});

and the Viewport.js:

app.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
//put instances of cards into app.views namespace
Ext.apply(app.views, {
//contactsList: new app.views.ContactsList(),
//contactDetail: new app.views.ContactDetail(),
//contactForm: new app.views.ContactForm()
});
//put instances of cards into viewport
Ext.apply(this, {
items: [
//app.views.contactsList,
//app.views.contactDetail,
//app.views.contactForm,
]
});
app.views.Viewport.superclass.initComponent.apply(this, arguments);
alert("Viewport ready");
}
});

My Question: What am I do wrong?

rcomas
27 Mar 2011, 9:44 PM
Hi, I am new to ST/Phonegap and was able to run the Contact app on iphone and ipad simulators successfully. However, when I run it on the iPad it doesn't show the viewport and gives me this error:

Contacts[1292:707] [INFO] Error in user's result callback: TypeError: Result of expression 'a.name' [undefined] is not an object.

I am not sure if I need to change something in order to run this app on an actual device. Any help would be highly appreciated.

Thanks.:s