设置新的SmartGWT主题'Tahoe'的问题

时间:2017-10-04 18:20:55

标签: java html gwt smartgwt isomorphic

Helly everybody, 我试图在示例gwt项目(问候服务)中设置新的'Tahoe'主题,该主题在smartgwt 6.1版中可用。 我希望有人能给我一些有用的提示。 我的问题是,我设置所有使用新主题,但如果我在浏览器中打开项目,新的皮肤不起作用。

我的代码: test.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
  "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module rename-to='gwtclientserverexample'>

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

  <inherits name="com.smartclient.theme.tahoe.Tahoe" />

  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.sample.gwt.client.GWTClientServerExample'/>

  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>
  <source path='shared'/>

  <!-- allow Super Dev Mode -->
  <add-linker name="xsiframe"/>
</module>

的index.html

<!doctype html>
<!-- The DOCTYPE declaration above will set the     -->
<!-- browser's rendering engine into                -->
<!-- "Standards Mode". Replacing this declaration   -->
<!-- with a "Quirks Mode" doctype is not supported. -->

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <title>Web Application Starter Project</title>

   </head>
  <body>

    <script type="text/javascript">
        var isomorphicDir = "gwtclientserverexample/sc/";
    </script>

    <script src="gwtclientserverexample/sc/modules/ISC_Core.js?isc_version=10.1.js"></script>

    <!--include SmartClient -->
    <script src="gwtclientserverexample/sc/modules/ISC_Foundation.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_Containers.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_Grids.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_Forms.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_RichTextEditor.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_Calendar.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_DataBinding.js?isc_version=10.1.js"></script>
    <script src="gwtclientserverexample/sc/modules/ISC_Drawing.js?isc_version=10.1.js"></script>

    <!--load skin-->
    <script src="gwtclientserverexample/sc/skins/Tahoe/load_skin.js?isc_version=9.1.js"></script>

    <script type="text/javascript" language="javascript" src="gwtclientserverexample/gwtclientserverexample.nocache.js"></script>


    <h1>Web Application Starter Project</h1>

    <table align="center">
      <tr>
        <td colspan="2" style="font-weight:bold;">Please enter your name:</td>        
      </tr>
      <tr>
        <td id="nameFieldContainer"></td>
        <td id="sendButtonContainer"></td>
      </tr>
      <tr>
        <td colspan="2" style="color:red;" id="errorLabelContainer"></td>
      </tr>
    </table>
  </body>
</html>

如果我打开浏览器,项目看起来如此: enter image description here

2 个答案:

答案 0 :(得分:2)

如果您使用此标记

<inherits name="com.smartgwt.SmartGwtNoScript" />

它将停止从index.html文件加载的任何脚本(包括你的Tahoe主题load_skin.js)

用于LGPL版本的正确标签,如果您只想切换默认主题是

<inherits name="com.smartgwt.SmartGwtNoTheme"/>

您可以在第79页的快速入门指南https://www.smartclient.com/releases/SmartGWT_Quick_Start_Guide.pdf中找到与此相关的信息,并切换主题&#39;

答案 1 :(得分:0)

我在@Alan的帮助下解决了我的问题。

我需要包括:

<inherits name="com.smartgwt.SmartGwtNoTheme" />

而不是:

<inherits name="com.smartgwtee.SmartGwtEENoTheme"/>

之后我可以加入新的Tahoe-Skin:

<inherits name="com.smartclient.theme.tahoe.Tahoe" />

我的* .gwt.xml现在看起来如此:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
  "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module rename-to='gwtclientserverexample'>

  <inherits name="com.smartgwt.SmartGwtNoTheme" />
  <inherits name="com.smartclient.theme.tahoe.Tahoe" />

  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.sample.gwt.client.GWTClientServerExample'/>

  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>
  <source path='shared'/>

  <!-- allow Super Dev Mode -->
  <add-linker name="xsiframe"/>
</module>