27 Feb 2012 12:19 PM #1
Where and how to store images?
Pardon if I'm missing the obvious but I'm trying to add a custom image label to my app. By default when I add the img control it is populated with Sencha logo and is referenced as "resources/images/sencha.png". There's no "resources" directory in the project source tree so I'm assuming that this file is loaded remotely. Does that mean that I have to have a running webserver and specify my image source using "http://foo.com/resources/images/foo.png"? Is there a way to add a static image files to the project ans have these published as part of the deploy?
27 Feb 2012 12:25 PM #2
You can create/add any additional files into the projects working directory that you would like.
These will be included along with your deployment. You can reference these files relative to your urlPrefix/where you are developing/deploying.Aaron Conran
27 Feb 2012 1:03 PM #3
Are you referring to the directory containing .metadata folder? If so - I manually created resources/images dir there and added foo.png. No image is shown in Designer which is not surprising to me since I think it is looking at some remote location. And when I do deploy the resource folder is not copied to my destination
27 Feb 2012 1:06 PM #4
Yes, your project directory.
All additional files/folders here will copied to your deploy directory.
Is your project directory in a webroot and does it match your urlPrefix in your settings?Aaron Conran
27 Feb 2012 2:03 PM #5
OK - it does copy everything. Including .metadata and .svn folders (which I don't want is there any way to prevent this?). My project directory is not under my webserver. I'm using Tomcat so I deploy files under unwrapped WAR directory.
I get it to the point where after deploy I can see my image file on the webserver but that doesn't help me to build my UI in Designer since I can't get my image to display there
So I have:
Ext JS Path: http://extjs.cachefly.net/ext-4.0.2a/
Sencha.io Library path: http://extjs.cachefly.net/designer/IO/
URL Prefix: http://localhost:8080/foo/
Deploy path: C:/dev/workspaces/td/ui/foo/src/main/webapp
27 Feb 2012 2:15 PM #6
The file will have to be servable by your urlPrefix and the relative path during design time if you wish to see it.
We are working on some fixes regarding .metadata, .svn, etcAaron Conran
27 Feb 2012 2:22 PM #7
The only way I can get it working is to provide absolute network location e.g. http://localhost:8080/foo/resources/images/foo.png. If I set my urlPrefix to http://localhost:8080/foo and relative path to resources/images/foo.png I see nothing. And again, where does sencha.png is coming from?
27 Feb 2012 2:31 PM #8
I just tested this and its currently broken/not working as it should.
The sencha.png is an internal resource.Aaron Conran
6 Mar 2012 12:22 PM #9
- Join Date
- May 2010
- Guatemala, Central America
- Vote Rating
6 Mar 2012 12:47 PM #10
No. It will still work in deployed version but will not show up in design mode.Aaron Conran