Selecting external CSS file

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Selecting external CSS file

Postby svjim » Thu Jan 31, 2008 12:23 pm

I am sure that it is that I am a beginner with GWT Designer, but I am having difficulty with adding external css files to to the wizard and then once they are added, assigning the style to elements in my project

Even after adding and saving a reference to a css file in the projects html file, the file does not show up in the wizard. I have to go through a few gyrations to get it to show up. I compile the gwt project and shut down and reopen eclipse before I can see the file.

Once I can see the css file in the wizard, I am having difficulty assigning styles to elements. For the most part I can, then all of a sudden it will work. Not sure what is happening here. I am using the iui.css style file and it has some extensions for safari in it. I am not sure if that is causing a problem.

Any help or advise would be appreciated.


Jim
svjim
 
Posts: 1
Joined: Thu Jan 31, 2008 12:12 pm

Re: Selecting external CSS file

Postby Eric Clayberg » Fri Feb 01, 2008 10:34 am

1. You should not use external files. Just put your CSS file into the "public" folder of your GWT module.

2. If you save the file using some external tool, don't forget to refresh your Eclipse project.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Selecting external CSS file

Postby cberry » Tue Apr 01, 2008 12:46 pm

I am also seeing this same problem regarding a stylesheet. I have the stylesheet in the public folder and it is referenced in the HTML file as well as the xml file.

I've attached an image of the file structure.

Any help would be great.

Thanks,
Charlotte
csserror.png
XML
csserror.png (6.14 KiB) Viewed 1420 times


Here's the XML file:
<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<!-- Inherit the GWTExt Toolkit library configuration. -->
<inherits name='com.gwtext.GwtExt' />

<!-- Inherit web reporting -->
<inherits name='com.mycompany.webreporting.webreporting' />

<!-- Inherit an image bundle -->
<!-- <inherits name='' /> -->

<!-- Specify the app entry point class. -->
<entry-point class='com.mycompany.client.SARWeb'/>

<stylesheet src='MainTemplate.css'/>
<stylesheet src='js/ext/resources/css/ext-all.css'/>

</module>

Here's the HTML file:
<html>
<head>
<title>Service Automation Reporter</title>
<link rel="stylesheet" HREF="MainTemplate.css" TYPE="text/css">
<link rel="stylesheet" HREF="js/ext/resources/css/ext-all.css" TYPE="text/css">
</head>

<body class="body">
<!-- load the ext-js 2.02 scripts -->
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />

<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script language='javascript' src='com.mycompany.sar.nocache.js'></script>

</body>
</html>
cberry
 
Posts: 2
Joined: Tue Apr 01, 2008 12:30 pm

Re: Selecting external CSS file

Postby Konstantin.Scheglov » Tue Apr 01, 2008 10:40 pm

In general your configuration works for me.
May be one trick is that you should use "refresh" action (in Designer toolbar).
Screenshot - 02.04.2008 , 10_43_04.png
Test and Refresh actions
Screenshot - 02.04.2008 , 10_43_04.png (739 Bytes) Viewed 1381 times


...or just reopen editor.
Also note that you changed HTML file in the way that will not work with GWT-Ext.
You should not close <script/> tag, use <script></script> instead.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: Selecting external CSS file

Postby cberry » Wed Apr 02, 2008 5:32 am

I corrected the script tags and refreshed in Designer.

I still cannot access the CSS file.
cberry
 
Posts: 2
Joined: Tue Apr 01, 2008 12:30 pm

Re: Selecting external CSS file

Postby Konstantin.Scheglov » Wed Apr 02, 2008 5:49 am

Please send complete project to support.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests