PDA

View Full Version : Intermittent blank screen



joelennon
4 Mar 2011, 2:32 AM
Hi,

I am using Sencha MVC to structure my application. I'm having a problem with setActiveItem that I have a feeling is related to the way I'm setting up my controllers. Basically I intermittently get a blank screen on my detail view (show function in the controller). I navigate to this view either via the URL or from an Ext.List view via the controller. The problem is not limited to one controller, it happens with any part of the application that I structure in this way.

The following is an example of my controller code:


Ext.regController("LeaveRequest", {
index: function(options) {
if(!this.panel) {
this.panel = new coremobile.views.LeaveRequest({});
}
this.application.viewport.setActiveItem(this.panel, options.animation);
},

show: function(options) {
var request_id = options.id,
request = Ext.getStore("leaveRequestsStore").getById(request_id);

if(!this.detailPanel) {
this.detailPanel = new coremobile.views.LeaveRequestDetail({});
}

if(request) {
this.detailPanel.updateWithRecord(request);
this.application.viewport.setActiveItem(this.detailPanel, options.animation);
}
}
});

I wonder is it something to do with the way I initialize the detailPanel?

As I said above, this works about 75% of the time, it's just intermittently a problem, but it's a fairly big problem when it does happen as the screen is completely blank.

Any ideas?

joelennon
4 Mar 2011, 3:07 AM
Adding:


this.detailPanel.show();

above


this.application.viewport.setActiveItem(this.detailPanel, options.animation);

fixed the problem.

Strange one!