Ext4.define('Kwf.Ext4.App.MainController', {
    extend: 'Ext.app.Controller',
    requires: [
        'Ext.state.LocalStorageProvider',
        'Ext.state.Manager',
        'Kwf.Ext4.Viewport'
    ],
    mainPanel: null,
    onLaunch: function()
    {
        if (Ext4.supports.LocalStorage) {
            Ext4.state.Manager.setProvider(new Ext4.state.LocalStorageProvider());
        }
        Ext4.Ajax.disableCaching = false;
        if (!Ext4.Ajax.extraParams) Ext4.Ajax.extraParams = {};
        if (Kwf.sessionToken) Ext4.Ajax.extraParams.kwfSessionToken = Kwf.sessionToken;
        Ext4.Ajax.extraParams.applicationAssetsVersion = Kwf.application.assetsVersion;

        if (!this.mainPanel || !this.mainPanel instanceof Ext4.panel.Panel) {
            throw new Error("mainPanel is required and must be an Ext4.panel.Panel");
        }
        Ext4.create('Kwf.Ext4.Viewport', {
            items: [this.mainPanel]
        });
    }
});

@@ -246,16 +246,316 @@
 )%0A    %7B%0A
+        if (!this.mainPanel %7C%7C !this.mainPanel instanceof Ext4.panel.Panel) %7B%0A            throw new Error(%22mainPanel is required and must be an Ext4.panel.Panel%22);%0A        %7D%0A        Ext4.create('Kwf.Ext4.Viewport', %7B%0A            items: %5Bthis.mainPanel%5D%0A        %7D);%0A    %7D,%0A%0A    init: function()%0A    %7B%0A
         
@@ -966,274 +966,8 @@
 ion;
-%0A%0A        if (!this.mainPanel %7C%7C !this.mainPanel instanceof Ext4.panel.Panel) %7B%0A            throw new Error(%22mainPanel is required and must be an Ext4.panel.Panel%22);%0A        %7D%0A        Ext4.create('Kwf.Ext4.Viewport', %7B%0A            items: %5Bthis.mainPanel%5D%0A        %7D);
 %0A   

move code to init funktion to have extraParams set as stores could already start a load