Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14th Jan 2009, 18:01
alided alided is offline
Registered Developer
 
Join Date: Jan 2009
Posts: 5
Default Setting/defining resource(css, image, etc) loacation

Hi,
I'm trying to separate location of the jsp file which includes compiled js from js itself into two different directories. It seams that after loading the location of the resources is some how hard coded and browser tries to load the css and images from the path of the jsp.

Same problem might happened if i have 2 different modules and i want to share the resources between them.

Any way to solve this ?
Any workaround ?

Thanks
Alided
Reply With Quote
  #2  
Old 14th Jan 2009, 21:43
sjivan sjivan is offline
Registered Developer
 
Join Date: May 2008
Posts: 1,534
Default

I believe this is a GWT issue which is targeted for the 1.6 release which should be out soon. I'll try digging up that issue in GWT tracker.

Sanjiv
Reply With Quote
  #3  
Old 15th Jan 2009, 07:26
alided alided is offline
Registered Developer
 
Join Date: Jan 2009
Posts: 5
Default

Hi Sanjiv,
I don't think it's GWT issue, i did the same thing in ext-gwt and it was working, I think the difference is that in ext-gwt i could manually include css either into jsp file with arbitrary location or put it inside *.gwt.xml with different location, so question is can i do the same for smartGWT ?

Thanks
Reply With Quote
  #4  
Old 19th Jan 2009, 07:58
la123 la123 is offline
Registered Developer
 
Join Date: Dec 2008
Posts: 91
Default

I think that you should set isomorphicDir. Also, inherit your module from SmartGWTNoScript:
Code:
    <!-- If you decide to declare the js files in the html use SmartGwtNoScript -->
    <!-- Only includes SmartGWT API's without JS and skins.
    User will need will need to separately inherit SmartClient and skin modules as desired,
    or add the JS and skin includes in their host html.
    -->
    <inherits name="com.smartgwt.SmartGwtNoScript"/>
And in your html / jsp:

Code:
<SCRIPT>
window.isomorphicDir='<%=myBase%>/static/gwt/smartgwt/js/sc/';
</SCRIPT>

<!--include the SC Core API-->
<script src=static/gwt/smartgwt/js/sc/modules/ISC_Core.js?isc_version=7.0beta.js></script>

<!--include SmartClient: only include the js files you need -->
<script src=static/gwt/smartgwt/js/sc/modules/ISC_Foundation.js?isc_version=7.0beta.js></script>
<script src=static/gwt/smartgwt/js/sc/modules/ISC_Containers.js?isc_version=7.0beta.js></script>
<script src=static/gwt/smartgwt/js/sc/modules/ISC_Grids.js?isc_version=7.0beta.js></script>
<script src=static/gwt/smartgwt/js/sc/modules/ISC_Forms.js?isc_version=7.0beta.js></script>
Reply With Quote
  #5  
Old 19th Jan 2009, 10:55
alided alided is offline
Registered Developer
 
Join Date: Jan 2009
Posts: 5
Default

Thanks la123. I think that what i'm looking for!!!! I'll try it today.
Reply With Quote
  #6  
Old 22nd Jan 2009, 13:12
smartgwt.dev smartgwt.dev is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 1,091
Default

Any updates on this? Were you able to try it out?
Reply With Quote
  #7  
Old 25th Jan 2009, 14:22
ysbelman ysbelman is offline
Registered Developer
 
Join Date: Jan 2009
Posts: 39
Default

It's not working for me. I used
Code:
<inherits name="com.smartgwt.SmartGwtNoScript"/>
and
Code:
<script>var isomorphicDir = "/company/secure/net.company.ui.TestView/jsXXXXX/sc/"</script>

<script type="text/javascript">
  document.write("<"+"script src=net.company.ui.TestView/jsXXXXXXX/sc/skins/" + currentSkin + "/load_skin.js?isc_version=7.0beta.js><"+"/script>");
</script>
when the app loads and i view an image properties, i get this url:
Code:
http://localhost:8880/company/secure/js/sc/skins/standard/images/TreeGrid/opener_opened.gif
XXXXX is completely ignored. The url is being picked up from somewhere else.
Reply With Quote
  #8  
Old 2nd Mar 2009, 12:43
atifkhan atifkhan is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 2
Default

I traced it down to the "sc" value not being initialized properly. It
looks like the
default sc dir is specified under WEBAPP. Where GWT1.6 created sc is under
WEBAPP/MODULE_NAME/sc/.

WORKAROUND:
=============
All I had to do to make this work was:

Add the following to your host html file before the nocache.js script tag.
<script>
var isomorphicDir = "[MODULE_NAME]/sc/";
</script>

Where MODULE_NAME is the module you are building.


SEE
http://code.google.com/p/smartgwt/issues/detail?id=36
http://code.google.com/p/smartgwt/issues/detail?id=139

Last edited by atifkhan; 2nd Mar 2009 at 16:05..
Reply With Quote
  #9  
Old 2nd Mar 2009, 15:57
erickr erickr is offline
Registered Developer
 
Join Date: Feb 2008
Posts: 73
Default

I'm using GWT 1.5.3 and SmartClient 7.0b2. When adding
<script>
var isomorphicDir = "[MODULE_NAME]/sc";
</script>

I found that it needed a trailing slash like {MODULE_NAME]/sc/ and this worked when I deployed the application but I could not get it to work in hosted mode.

I was able to use the Enterprise skin by adding the following to my module file.

<inherits name='com.smartclient.theme.enterprise.Enterprise' />

It looks similar to the standard skin but indeed more enterprise like.

Thanks,
Eric
Reply With Quote
  #10  
Old 2nd Mar 2009, 16:10
atifkhan atifkhan is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 2
Default

Thanks erickr!

I have corrected the post. Also there is a link to a zip file that has the sample helloworld working for both GET 1.6 and GWT 1.5 with SMARTGET 1.0b2 fo both hosted and compiled mode. The ant script can launch the hosted mode (Please remember to update the ant properties (at the top of the build.xml file) before running the ant scripts.

http://smartgwt.googlecode.com/issues/attachment?aid=-1767778415466536332&name=gwt.zip
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved