-
FEATURED COMPONENTS
First time here? Check out the FAQ!
我通过扩展org.zkoss.zul.Window类实现了一个组件,组建中有一个按钮控件,我想用中文标题.但是直接在.java文件中设置标题,在浏览器中不能正常显示中文编码,如果在.zul文件里输入中文是可以显示的,所以我觉得这不是浏览器的问题。
请问如何使.java文件中的中文能够正常显示?谢过先。
我是在那个Java类中,创建了一个Button对象,在constructor里面输入的中文,然后在.zul中又使用了这个类创建组建,不知和这又没有什么关系.ZK底层不是用JSP实现的吗?我现在感觉,这个问题是不是和JSP的编码问题有关系.
This is the .zul file that use my class.
<?xml version="1.0" encoding="UTF-8"?>
<zk>
<zscript language="java" src="components/ListWindow.java"/>
<window id="LIST_MAIN" use="ListWindow"/>
</zk>
And this is part of my code.
/* Initialize modify button */
modify = new Button( "修改..." );
modify.setImage( "components/modify_icon24.png" );
modify.setWidth( "25pt" );
/* Add onClick event listener */
modify.addEventListener( "onClick", new EventListener(){
public void onEvent( Event event ){
modifyModal(); // This part process the event
}
} );
div.appendChild( modify );
您试试看.这是代码片断,我想在window中添加一个中文标签的Button.我觉得应该足以说明问题,要是您觉得不行,我再贴出来些.
再次感谢.
following code works on http://www.zkoss.org/zkdemo/userguide/
<window id="win"> <toolbarbutton label="add new btn" onClick='win.appendChild(new Button("修改..."))'> </toolbarbutton> </window>
Asked: 2009-05-17 14:09:03 +0800
Seen: 213 times
Last updated: May 20 '09