Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Issue With Changing/Selecting Themes

    I am using SmartGWT 2.4 (nightly build from 1/22/2011).

    Browser: All (Tested on FF 3.x and 4.0, Chrome latest, Safari 5.x)

    I have been following various threads regarding dynamic changing of themes. For some reason, no matter what my inherits are when I compile my project I ALWAYS get the Enterprise theme as one of the skins along with any other themes I've inherited. And no matter what my app always uses the Enterprise theme even with the correct redirect to another theme (in this case Graphite).

    If someone could point me in the right directions I'd really appreciate it. Here's the contents of my project.xml:

    Code:
     <inherits name="com.google.gwt.i18n.I18N"/>
      <inherits name="com.google.gwt.user.User"/>
      <inherits name="com.google.gwt.core.Core"/>
      <inherits name="com.google.gwt.user.History"/>
      
      <inherits name="com.smartgwt.SmartGwtNoScript"/> 
      <inherits name="com.smartgwt.tools.SmartGwtTools"/>
      
      <inherits name="com.smartclient.theme.graphite.GraphiteResources"/>
      <inherits name="com.smartclient.theme.simplicity.SimplicityResources"/>
    And here's the index.html for the project:

    Code:
    	<script src="https://ssl.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"> </script> 
    
        <script src='myapp/sc/modules/ISC_Core.js'></script>
        <script src='myapp/sc/modules/ISC_Foundation.js'></script>
        <script src='myapp/sc/modules/ISC_Containers.js'></script>
        <script src='myapp/sc/modules/ISC_Grids.js'></script>
        <script src='myapp/sc/modules/ISC_Forms.js'></script>
        <script src='myapp/sc/modules/ISC_RichTextEditor.js'></script>
        <script src='myapp/sc/modules/ISC_DataBinding.js'></script>
        <script src='myapp/sc/modules/ISC_PluginBridges.js'></script>
    
    	<script>
    		function readCookie(name) {
    			var nameEQ = name + "=";
    			var ca = document.cookie.split(';');
    			for(var i=0;i < ca.length;i++) {
    				var c = ca[i];
    				while (c.charAt(0)==' ') c = c.substring(1,c.length);
    				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    			}
    			return null;
    		}
    	
    		// Determine what skin file to load
    		var currentSkin = readCookie('skin_name_2_4');
    		if (currentSkin == null) currentSkin = "Graphite";
    	</script>
    
    	<script type="text/javascript">
    		document.write("<"+"script src=myapp/sc/skins/" + currentSkin + "/load_skin.js?isc_version=7.1.js><"+"/script>");
    	</script>
    
    	<script type="text/javascript" language="javascript" src="myapp/myapp.nocache.js"></script>  
     
      </head>
    
      <body>  
    
       	<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>	
    	
      </body>
    Thanks!

    Chris

    #2
    Anyone?

    Thanks.

    Comment


      #3
      I also get the Enterprise theme loaded and have the entry in the applications.nocache.js file:
      ----excerpt form application.gwt.xml file-----
      <!-- Inherit the core Web Toolkit stuff. -->
      <inherits name='com.google.gwt.user.User'/>
      <inherits name="com.smartgwt.tools.SmartGwtTools"/>
      <inherits name="com.smartgwtpro.SmartGwtProNoScript"/>
      <inherits name="com.smartgwtpro.SmartGwtProNoTheme"/>
      <inherits name="com.smartclient.theme.blackops.BlackOps"/>
      <inherits name="com.smartgwtpro.tools.Tools"/>

      ----excerpt from application.nocache.js file
      if (!__gwt_scriptsLoaded['sc/skins/BlackOps/load_skin.js']) {
      __gwt_scriptsLoaded['sc/skins/BlackOps/load_skin.js'] = true;
      document.write('<script language="javascript" src="' + base + 'sc/skins/BlackOps/load_skin.js"><\/script>');
      }
      if (!__gwt_scriptsLoaded['sc/skins/Enterprise/load_skin.js']) {
      __gwt_scriptsLoaded['sc/skins/Enterprise/load_skin.js'] = true;
      document.write('<script language="javascript" src="' + base + 'sc/skins/Enterprise/load_skin.js"><\/script>');
      }

      Comment

      Working...
      X