0

大家好,我正在尝试在示例 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>

索引.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>

如果我打开浏览器,项目看起来是这样的: 在此处输入图像描述

4

2 回答 2

3

如果你使用这个标签

<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中找到与此相关的信息

于 2017-10-04T18:52:50.023 回答
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>
于 2017-10-05T06:13:50.623 回答