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 8th Jul 2009, 07:24
AW AW is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 67
Default Disabled TextItem looking for image in wrong place

I am using the Enterprise skin in SmartGWT 1.1.

I have been experimenting with programmatically disabling items in a DynamicForm. When I set any TextItem fields to disabled in Internet Explorer 7, a small red cross appears over the item. It appears that it is looking for the file \sc\skins\standard\images\blank.gif.

I have tried creating the required directories (standard and images) and copying the Enterprise blank.gif to the above location within my compiled webapp’s directory structure. That’s a work-around for the problem.

Is this a bug in SmartGWT?
Reply With Quote
  #2  
Old 16th Jul 2009, 12:00
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 37,383
Default

This kind of thing could happen if you are creating components before load_skin.js has loaded. Have you customized the .html output from GWT? Can you show your .html bootstrap file?
Reply With Quote
  #3  
Old 23rd Jul 2009, 08:51
AW AW is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 67
Default

We have modified the Host HTML file, I have reproduced it below.

We use RootPanel.get().add() to add things to the page. The stuff we have in our Host HTML is just for while the application is loading. We hide it once have loaded and are adding things to the RootPanel.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />

	<meta name="robots" content="all" />
	<meta http-equiv="Content-Language" content="en-us" />
	<meta name="copyright" content="[Company Name] - [Current Year]" />

<title id="appTitle"></title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 

    <!--CSS for loading message at application Startup-->
    <style type="text/css" media="screen">	
		@import "css/base.css";
		@import "css/interface.css";
		@import "css/tables.css";
		@import "DatePicker.css";
    </style>

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

<script> var isomorphicDir = "com.mycompany.myui.MyUiApp/sc/"; </script> 

</head>

<!--                                           -->
<!-- The body can have arbitrary html, or      -->
<!-- you can leave the body empty if you want  -->
<!-- to create a completely dynamic UI.        -->
<!--                                           -->
<body id="top">

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

<!--add loading indicator while the app is being loaded-->
<div id=loadingEnvelope>
	<!--Header-->
	<div id="loadingHeader">
		<h1 id="loadingLogo"><a href="#">mycompany, Ltd.</a></h1>						
	</div><!--/div#loadingHeader-->
	<div class="mainContentEnvelope">
		<div class="mainContentInner">
			<div class="tl"><div class="tr"></div></div>
			<div class="mainContent">
				<div id=loadingEnvelope1>
					<div id="psy-LoadingMessage"><div>Loading Application ... please wait</div>
					</div><!-- /psy-LoadingMessage -->
				</div><!--  /div.loadingEnvelope1 -->
			</div><!-- /div.mainContent -->
		</div><!-- /div.mainContentInner -->
	</div><!-- /div.mainContentEnvelope -->
	<div id="loadingFooter">&copy; <a href="http://www.mycompany.com"
		target="_blank">mycompany Ltd.</a> 2009</div>
</div><!--  /div.loadingEnvelope -->

<div id="popupForm" >
</div>

<div id="popupProgress" >
</div>

</body>
</html>
Our application's .gwt.xml file:

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

      <!-- Inherit SmartGWT -->
	<inherits name="com.smartgwt.SmartGwt" />

      <!-- Inherit the default GWT style sheet.  You can change       -->
      <!-- the theme of your GWT application by uncommenting          -->
      <!-- any one of the following lines.                            -->
      <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
      <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
      <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

      <!-- Other module inherits                                      -->
	<inherits name="com.google.gwt.i18n.I18N" />

      <!--  <extend-property name="locale" values="fr"/> 			  -->

      <!-- Specify the app entry point class.                         -->
	<entry-point class='com.mycompany.myui.client.MyUiApp' />
	<servlet path="/myui" class="com.mycompany.myui.server.rpc.MyUiServiceImpl" />
	


      <!-- Specify the application specific style sheet.              -->
	<stylesheet src='MyUiApp.css' />
</module>
Reply With Quote
  #4  
Old 23rd Jul 2009, 08:53
mihai007 mihai007 is offline
Registered Developer
 
Join Date: Dec 2008
Posts: 273
Default

have you tried to switch:

<script type="text/javascript" language="javascript"
src="com.mycompany.myui.MyUiApp.nocache.js"></script>

<script> var isomorphicDir = "com.mycompany.myui.MyUiApp/sc/"; </script>

It seems it has more sence switched.
Reply With Quote
  #5  
Old 27th Jul 2009, 08:38
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 37,383
Default

Just checking in on this - the suggested change of setting isomorphicDir before loading SmartClient seems correct - did this resolve the issue for you?
Reply With Quote
  #6  
Old 3rd Aug 2009, 05:53
pedjacar pedjacar is offline
Registered Developer
 
Join Date: Jun 2009
Posts: 13
Default

Hi,

I am also experiencing the same problem, but setting isomorphic dir before loading SmartClient did not resolve the issue (it is setup like this from the start of the project).

HTML:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   
    <title>Title</title>
    
    <!--  Needed for SmartGWT in GWT 1.6 -->
    <script>
	var isomorphicDir = "myapp/sc/";
    </script>
    <script type="text/javascript" language="javascript" src="myapp/myapp.nocache.js"></script>
  </head>
                                          
  <body>
  	<!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
  </body>	
</html>
Reply With Quote
  #7  
Old 4th Aug 2009, 12:11
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 37,383
Default

@pedjacar get rid of your XHTML doctype and use an HTML one (if you declare one at all - it's not necessary and in some cases slower).

@AW did your problem get resolved by the isomorphicDir setting?
Reply With Quote
  #8  
Old 5th Aug 2009, 01:25
pedjacar pedjacar is offline
Registered Developer
 
Join Date: Jun 2009
Posts: 13
Default

Removing the doctype helped - the img with false src attribute is no longer generated (span is generated instead).
Reply With Quote
  #9  
Old 5th Aug 2009, 01:33
AW AW is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 67
Default

Apologies for the delayed reply, I have been on holiday.

When I posted the example, we were using GWT 1.6.4. I have tried the suggested change of setting isomorphicDir before loading SmartClient in our GWT 1.6.4 branch. This did not resolve the problem, and in fact made things worse, as none of the SmartGWT images then appeared in my application.

While I was away, we upgraded to GWT 1.7.0. As part of this process we restructured our host HTML file. That included setting the isomorphic dir before the script line that points to the nocache.js file. We get the same behaviour as originally reported – images are found for most SmartGWT elements, but not the \sc\skins\standard\images\blank.gif. I don’t know why it is looking in skins\standard when we are using the Enterprise skin.
Reply With Quote
  #10  
Old 5th Aug 2009, 15:12
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 37,383
Default

If setting isomorphicDir caused all the images to disappear in the older version, that just means the setting was wrong.

The problem with "blank.gif" indicates that some application code is calling image-related methods before load_skin.js has been loaded (load_skin.js is what actually sets the skin to Enterprise). However we have no been able to actually reproduce this yet. If you look at Firebug as your application loads, do you in fact see application code files arriving before load_skin.js?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved