大家好, 我正在尝试在示例 gwt 项目(问候服务)中设置 smartgwt 版本 6.1 中提供的新“Tahoe”主题。 我希望有人能给我一些有用的提示。 我的问题是,我将所有设置都设置为使用新主题,但如果我在浏览器中打开项目,新皮肤将无法工作。
我的代码: 测试.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>
如果您使用此标签
<inherits name="com.smartgwt.SmartGwtNoScript" />
它将停止从您的index.html文件加载任何脚本(包括您的Tahoe主题load_skin.js)
如果您只想切换默认主题,则用于 LGPL 版本的正确标签是
<inherits name="com.smartgwt.SmartGwtNoTheme"/>
您可以在快速入门指南https://www.smartclient.com/releases/SmartGWT_Quick_Start_Guide.pdf第81页的“切换主题”下找到与此相关的信息
我在@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>