【问题标题】:Problems setting new SmartGWT Theme 'Tahoe'设置新 SmartGWT 主题“Tahoe”时出现问题
【发布时间】:2018-03-16 05:57:18
【问题描述】:

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

如果我打开浏览器,项目看起来是这样的:

【问题讨论】:

    标签: java html gwt smartgwt isomorphic


    【解决方案1】:

    如果你使用这个标签

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

    【讨论】:

    • 感谢您的回答,但如果我包含 我收到以下错误:[ERROR] Unable to find 'com/smartgwtee/SmartGwtEENoTheme.gwt .xml' 在您的类路径中;可能是拼写错误,或者您忘记包含源的类路径条目?我正在使用 SmartGWT 的 LPGL 版本。
    • 啊,真的吗?抱歉,我以为所有版本都是 com.smartgwtee.SmartGwtEENoTheme"。我会更新我的答案。
    【解决方案2】:

    我在@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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-07-05
      • 2013-03-17
      • 1970-01-01
      • 2014-07-05
      • 2021-10-16
      • 1970-01-01
      • 2021-09-07
      相关资源
      最近更新 更多