PDA

View Full Version : [FIXED] Sencha Touch 2 Project using appFolder configuration continues to use default of app



Artistan
20 Jan 2012, 1:43 PM
http://visits.benint.net/visits/touch-model/designer.html

it is trying to load from folder "app" when clearly defined with a different name and appFolder.


Ext.application({
appFolder: 'BenAdmin',
autoCreateViewport: true,
defaultUrl: 'http://visits.brokerbin.com/visits/touch/',
name: 'BenAdmin',

models: [
'Visit',
'VisitsStats',
'VisitsSites',
'VisitsList',
'AllCompanies',
'AllReps'
],

stores: [
'Visit',
'VisitsStats',
'VisitsSites',
'VisitsList',
'AllCompanies',
'AllReps'
],

controllers: [
'Visits'
],

launch: function() {

}
});



GET http://visits.benint.net/visits/touch-model/app/model/Visit.js?_dc=1327095196940 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/Visit.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/model/VisitsStats.js?_dc=1327095196949 404 (Not Found)




GET http://visits.benint.net/visits/touch-model/app/model/VisitsSites.js?_dc=1327095196955 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/VisitsStats.js', please verify that the file exists




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/VisitsSites.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/model/VisitsList.js?_dc=1327095196959 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/VisitsList.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/model/AllCompanies.js?_dc=1327095196964 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/AllCompanies.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/model/AllReps.js?_dc=1327095196969 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/model/AllReps.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/controller/Visits.js?_dc=1327095196973 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/controller/Visits.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/Visit.js?_dc=1327095196977 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/Visit.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/VisitsStats.js?_dc=1327095196982 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/VisitsStats.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/VisitsSites.js?_dc=1327095196986 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/VisitsSites.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/VisitsList.js?_dc=1327095196991 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/VisitsList.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/AllCompanies.js?_dc=1327095196996 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/AllCompanies.js', please verify that the file exists




GET http://visits.benint.net/visits/touch-model/app/store/AllReps.js?_dc=1327095197000 404 (Not Found)




sencha-touch-all-debug.js:4897 (http://extjs.cachefly.net/touch/sencha-touch-designer-edition/sencha-touch-all-debug.js)Uncaught Error: [Ext.Loader] Failed loading 'app/store/AllReps.js', please verify that the file exists

aconran
30 Jan 2012, 10:44 PM
Thanks for the report. I know appFolder was removed from ST2 but then reintroduced recently. We will followup to determine if this is an SDK or Designer problem.

Thanks,

aconran
6 Feb 2012, 3:20 PM
Related problem:
http://www.sencha.com/forum/showthread.php?178219-appFolder-with-subdirectories

keithjjones
6 Feb 2012, 4:23 PM
Thank you for the quick reply on the other thread. I will continue writing here since the issue has already been classified as a bug. (You may want to jump to the last paragraph if you want my suggestion of a quick fix to this bug.)

I looked at this bug thread but I think it's description is a bit different than the problem the author of the other thread and I brought up. The author of the other thread and I are trying to address having parent directories and in this thread the author seems to be claiming that appFolder does not work at all.

I should have noted that I am using the standard Ext-JS v4 (not Touch) pointed to by default with Designer 2.0.0 build 268. Basically, the only way I can get my app to work correctly is to go into designer.js and add an appFolder property by hand with the full URL for the application. I have to do this *every* time I click save in Designer in order to bring up and test the web page that uses that application.

Basically, like the first post stated on the other thread you referenced, it should work something like this:

The user opens their browser and goes to:

http://www.somedomain.com/SomeDirectory

which through ASP provides the user's browser with HTML output and has a script tag in it to load something like:

http://www.somedomain.com/Scripts/OneOfMySenchaApps/designer.js.

I have verified that part all happens correctly, but once designer.js is loaded it tries to load the stores and views of the application named "OneOfMySenchaApps" and they are being called without parent directories, such as:

http://www.somedomain.com/app/store/MyJSONStore.js
(which doesn't actually exist)

instead of:

http://www.somedomain.com/Scripts/OneOfMySenchaApps/app/store/MyJSONStore.js
(whch is the correct URL).

The solution is changing the appFolder property in designer.js (by hand each time you click save in Designer) to:

appFolder: '/Scripts/OneOfMySenchaApps/app'

which is pretty tedious, error prone, and time consuming.

You can't place the string '/Scripts/MySenchaApp/app' in the Designer directly for the application's appFolder property because the '/' characters are not allowed by the Designer (plus Designer seems to rename some of the application's subdirectories automatically based upon its interpretation of the appFolder property, which may not actually address the original intent of the appFolder property).

Does that make more sense? The problem I am describing is not about the default appFolder path and it being potentially being broken. I can get it to work but it just takes some hand editing to do so each time the project is saved.

The quick fix? Enable special characters in the appFolder application property in Designer. Then, don't let Designer try to rename any subdirectories based upon the value of appFolder. Keep the subdirectory the same name as the the default "app" directory without renaming it. That would completely solve the issue, from what I can tell.

keithjjones
8 Feb 2012, 7:03 AM
I was wondering if you gentlemen had any other ideas that I did not think of for a workaround, even if it's just a temporary workaround until Designer v2 is updated, for the problem I presented above? Editing the designer.js by hand after every save is not fun. Thanks!

Phil.Strong
8 Feb 2012, 11:30 AM
@keithjjones It appears your right in that we need to be able to accept a path as well as a folder name here. In the end I suspect for production you'll be creating a single file and not using the loader at all in this manner.

@Artistan It seems that after the designer version of sencha touch 2 was updated to beta1 the issue you were seeing went away. The link about does now resolve all the files correctly.

keithjjones
8 Feb 2012, 1:25 PM
Thank you for your response. You are correct in that for production I will probably create a single file. However right now I'm developing so it's not that feasible to compile it to a single file to test it after every little change (which can be many times a day). Can you think of a better way than I suggested of getting around this issue other than hand editing designer.js to take the appFolder property correctly every time I click "save" in Designer?

By the way - I love all the improvements in v2! It's going to save a lot of design time for me once I figure a way around this little bug.

Phil.Strong
9 Feb 2012, 7:05 AM
the quickest work around is to copy the designer.js file and name it index.js and change it one time in that file.

the application is changed rather rarely once you get your project going. You can use source control to know when you need to update your index.js file w/ changes made in designer.js.

Then wait for Designer update to make this easier. We're talking w/ the framework team to figure out the route for this

keithjjones
13 Feb 2012, 2:32 PM
Great idea! I wouldn't have thought of that. Thanks for the tip!

keithjjones
27 Feb 2012, 9:50 AM
I am now using Version 2.0.0 build 298 (Release Channel 2.0-beta) and you can add slashes (/) to the appFolder which was exactly what I needed! Awesome! Thank you!

Now, the problem is that Designer takes it upon itself to rename the subdirectories under the project to whatever you put in "appFolder" which completely defeats the bug fix (you can read my previous example above to see why this won't work). Is there any way to separate what the output directories are for the project from the value of appFolder to get this to work correctly?

Thanks!

Take care,
Keith

Phil.Strong
27 Feb 2012, 10:00 AM
Now, the problem is that Designer takes it upon itself to rename the subdirectories under the project to whatever you put in "appFolder" which completely defeats the bug fix (you can read my previous example above to see why this won't work). Is there any way to separate what the output directories are for the project from the value of appFolder to get this to work correctly?


In your case you should be using Deploy to do what you'd like. Preview is coming soon which would break based on your suggestion.

What you need is a way to set appFolder to something different for when you deploy. Expect deploy to have lots of features added to it as we move forward.

Phil.Strong
27 Feb 2012, 10:04 AM
The workaround of using index.html (or whatever) still applies in the mean time.

keithjjones
5 Mar 2012, 1:17 PM
Cool. Thanks. When do you think the fix will be out?

aconran
5 Mar 2012, 1:19 PM
Additional deployment functionality will be post 2.0.

keithjjones
5 Mar 2012, 1:33 PM
PS - I do use the deploy functionality but it basically just copies over the contents of the development directory to the deployment directory which still makes this same issue come up (with the appFolder because it changes subdirectories). The only way I see this not being an issue (if you don't hand edit the index file as you suggested) is if the application was on the root level of the webserver. Maybe it's just me, but that seems like a rare case in many development scenarios. I have a few different applications I've written with Sencha tools that I need to keep in different directories (like the /scripts directory, for example). If every application looks to the root of the webserver for the Sencha "app" folder, nothing works correctly.

If there is something I am missing about using the deploy button to make this work (how I've described before in previous posts), please feel free to let me know. I've changed just about every variable I can find in the tool to get it to work and am now stuck except for the hand edit change you suggested.

avc.walli
23 Apr 2012, 11:53 PM
Any news regarding this topic?

Phil.Strong
25 Apr 2012, 12:06 PM
Also see http://www.sencha.com/learn/getting-started-with-ext-js-4#!/guide/getting_started-section-3

For the proper way to deploy. We'll be integrating this stuff in the future.