View Full Version : [FIXED] Bug in content of "Viewport.js"

17 Oct 2012, 1:42 AM
I seem to have found a bug in the program.
I have a project with two controllers and three views.
The main viewport is created automatically (autoCreateViewport property is true).
I want only two of these views are loaded when the application starts and I want the third view is loaded only when is loaded the second controller.
In fact, the second controller references correctly the third view and it is only referenced by this controller and no any other objects.
Nevertheless, when the application starts, while the second controller correctly is not loaded, the third view is loaded anyway.
The problem for me lies in the file "Viewport.js" that is automatically created by the program:

Ext.define ('App.view.Viewport', {
extend: 'App.view.AppViewport',
renderTo: Ext.getBody (),
requires: [

As you can see, in my opinion, the error is that the file is created including all the views in the project in the "requires" property, regardless of whether or not the views are to be obtained later, according to various settings of the project.
In my case, View3 should not be included in the list.
I think it would be appropriate to correct the creation and editing of the file "Viewport.js."

Thanks in advance.

17 Oct 2012, 7:52 AM
Hrm, have you removed these views from Application?

Does the viewport use these views?

Could you attach a project archive that illustrates the problem?

17 Oct 2012, 10:57 PM
Thank you very much for your kindly reply.
I shall soon give you more detailed information.

In my project the object "Application" references only the controller "Ulisse" and no views:


The controller "Ulisse" references only the two views "UlisseViewport" and "FinestraConnessione":


The controller "Indipendenti" references only the view "Independenti":


On the other hand, the viewport "UlisseViewport" not anything references:


Despite all these settings when the application starts, the view "Indipendenti" is loaded even though it should not be loaded at boot time:


In my opinion this is because the file "Viewport.js" (file automatically generated by Architect) the viewport referencing all three views regardless the settings in the project:

* File: app/view/Viewport.js
* This file was generated by Sencha Architect version 2.1.0.
* http://www.sencha.com/products/architect/
* This file requires use of the Ext JS 4.1.x library, under independent license.
* License of Sencha Architect does not include license for Ext JS 4.1.x. For more
* details see http://www.sencha.com/license or contact license@sencha.com.
* This file will be auto-generated each and everytime you save your project.
* Do NOT hand edit this file.

Ext.define('Ulisse.view.Viewport', {
extend: 'Ulisse.view.UlisseViewport',
renderTo: Ext.getBody(),
requires: [

For me, the bug is hiding just in the generation of this file. It would seem that it is created including all the views in the project ignoring all other settings in the project.

If you need any other information, I am at your disposal.

Thanks in advance.

18 Oct 2012, 1:35 PM
Thanks for the detailed info.

What does Ulisse.view.UlisseViewport look like and what other views does it use?

19 Oct 2012, 1:38 AM

The viewport "Ulisse.view.UlisseViewport" look like:


and as you can see (in the tree and in the property editor), it does not uses instances of the views in the project.
If you need some additional information, let me know as well.
Thanks in advance.


24 Oct 2012, 4:32 AM

Ext version tested:

Ext 4.1.1-gpl

Browser versions tested against:

Chrome 22.0.1229.94 m


Operating System:

WinXP Pro 5.1.2600 SP3 Build 2600

12 Nov 2012, 7:33 AM
Addressing this now ... I'll let you know what our proposal is

13 Nov 2012, 1:47 PM
After some analysis the team seems to think we should simply remove the requires statement altogether from the generated Viewport? Do you agree this solves the issue?

13 Nov 2012, 11:54 PM
Hi Phil!
In fact in my project I have just adopted this solution, removing unwanted items from the property "requires" from my own copy of Viewport and I verified that it prevents premature and unwanted loading of the views.
So, for me the solution is the right one.


16 Nov 2012, 12:32 PM
Awesome! It's going to be in the 2.2 release. Sorry you'll have to wait until then. No time for anymore patch releases.