PDA

View Full Version : [NOREPRO] 4.2 Beta appFolder config Ext.application do not work properly



mrinsan
6 Jan 2013, 10:48 AM
Facing problem with Ext.application in 4.2 Beta
i have my appFolder pointing to a different folder (not the default 'app' folder)

It is a Java/web application
and my ext application is sitting at client/desktop/app folder

when i specify this setting in 4.2 beta
while loading the controllers it seems to ignore this and trys to load them from the default app folder
however views and stores are assumed to be present in the appFolder path specified in the Ext.application config

this used to work fine with extjs 4.1 but broken in 4.2 beta

i have a fairly complex app and see many layouts issues while adding/removing components dynamically.
they work well in 4.1.

will post the test cases as and when i get time and find out the issues




Ext.application({ name: 'MyApp', launch: function () { console.log('app launched'); }, appFolder: 'client/desktop/app', controllers: [ 'AppController', 'ChartController' ]});

Stormseeker
7 Jan 2013, 11:37 AM
I'm having a similar problem, however I am using the 'paths' config value. When the application loads, it is still looking for the source files to be the /apps/model/ect... folder.

Basically, we don't have an apps folder. This was working for us in 4.1.0 and 4.1.1 but not in the 4.2 beta.



Ext.application({
name : 'QLP',
paths : {
'Ext' : '/javascript/extjs/src',
'Ext.ux' : '/javascript/extjs/examples/ux',
'QLP' : '.'
},
autoCreateViewport : true
});

nohuhu
8 Jan 2013, 10:30 AM
Thanks for reporting, I'll look into it.

Regards,
Alex.

nohuhu
8 Jan 2013, 11:08 AM
Can't reproduce this in current codebase. There was a bunch of changes to MVC since Beta 1, so I probably fixed it along. The fixes will be available in nightly builds for 4.2 once they're available (should be shortly), and of course in the next beta.

Regards,
Alex.

Stormseeker
11 Jan 2013, 8:05 AM
Can't reproduce this in current codebase. There was a bunch of changes to MVC since Beta 1, so I probably fixed it along..

I'm trying out Beta2 currently and things seem to be MUCH better. However I did notice a weird bug. It seems if you have some requires statements in the Ext.application config code, they are executed before the paths are resolved? Here is my code examples.



Ext.application({
requires : [
'QLP.ux.window.DropDownMessage'
],
name : 'QLP',
paths : {
'Ext' : 'javascript/extjs/src',
'Ext.ux' : 'javascript/extjs/examples/ux',
'QLP' : 'javascript/crm2',
'QLP.ux' : '/apps/common/ux'
},
autoCreateViewport : true,
...
});


Which gives me the following error in console:


GET http://www.extcrm.com:8010/QLP/ux/window/DropDownMessage.js?_dc=1357920129233 404 (Not Found) ext-all-dev.js:10275
Uncaught Error: [Ext.Loader] Failed loading 'QLP/ux/window/DropDownMessage.js', please verify that the file exists

However I reference other files that in the QLP.ux namespace later on in the application and it seems to find them correctly. Not sure if this is a timing issue or if the requires isn't aware of the paths config. :-?

Thanks,
Tim

Dumbledore
11 Jan 2013, 10:06 AM
same here...

nohuhu
11 Jan 2013, 11:14 AM
Huh, now that's definitely a bug. Thanks for spotting!

nohuhu
11 Jan 2013, 1:45 PM
Hmm. Looks like this one is not as simple as it seemed. I'll have to shelf it; meanwhile you can work around this problem by calling Ext.Loader.setPath() before Ext.application(). Or, better yet, take a look at Sencha Cmd - that's the tool that is supposed to handle all pathing for you.

Regards,
Alex.

Stormseeker
11 Jan 2013, 2:54 PM
Hmm. Looks like this one is not as simple as it seemed. I'll have to shelf it; meanwhile you can work around this problem by calling Ext.Loader.setPath() before Ext.application(). .

Yup, I'm using the Ext.Loader.setPath() workaround but wasn't sure if it was going to cause problems later on. Looks good so far. I'm also using Sencha Cmd but didn't want to have to run a build every time I make a change to source. Thanks for the tips. :D

lombardo
1 Feb 2013, 10:34 AM
I have the same error
It fixed if we add the path for the app in the paths config of the Ext.loader, ie:

Ext.Loader.setConfig({
disableCaching: false,
enabled: true,
paths: {
Ext: '.',
Sepp: 'app'
}
});

In version 4.1.3 it works..........but in 4.2 beta 2 it doesn´t work

Ron Howard
1 Feb 2013, 2:18 PM
Just do the full name of the object and it won't default to the app folder.
I've been doing this structure since 4.0. I did have to edit the path in 4.2 to go from the index.html location instead of my arch-app.js but that was it.



Ext.Loader.setConfig({
enabled: true,
paths: {
'MyApp': './js-4.2.0',
'Ext.ux.form': './js-4.2.0/plugin',
'Ext.ux': './js-4.2.0/plugin'
}
});

Ext.application({
name: 'MyApp.arch',
appFolder: './js-4.2.0/arch',
requires: [
'MyApp.arch.Init',
'MyApp.arch.Ajax'
]
});

My directory structure is below:


/ (webroot)
index.html
js-4.2.0/
arch-app.js
arch/
Init.js
Ajax.js

Ron Howard
5 Feb 2013, 1:55 PM
For Sencha Dev's. My 4.0.7 file structure worked for 4.1 with no changes but in 4.2 I had to make a few changes to make it work correctly. Below is the other thread discussing it.

http://www.sencha.com/forum/showthread.php?254758-4.2.0-RC-1-class-loading-behavior-changed&p=933512&viewfull=1#post933512