ZK 上传对话框不起作用 [英] ZK upload dialog not working

查看:42
本文介绍了ZK 上传对话框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Fileupload.get() 上传文件并且工作正常.

I am using Fileupload.get() to upload file and that is working fine.

但是,我想更改上传对话框的外观(例如添加更多按钮和更改文本位置),因此我修改了 zkStyle/web/zul 中的 fileuploaddlg.zul/html 文件夹,在我的 java 代码中,我在 Fileupload.get() 之前添加了 Fileupload.setTemplate("~./zul/html/fileuploaddlg.zul")>.

However, I want to change how the upload dialog look (like add more button and change position of the text) so I modified the fileuploaddlg.zul in my zkStyle/web/zul/html folder and in my java code I added Fileupload.setTemplate("~./zul/html/fileuploaddlg.zul") before Fileupload.get().

这根本没有修改上传对话框,所以我将 fileuploaddlg2.zul 添加到 zkStyle/web/zul/html 文件夹并更改了 setTemplateFileupload.setTemplate("~./zul/html/fileuploaddlg2.zul").这次我收到一个错误,说 ~./zul/html/fileuploaddlg2.zul 不存在.

This didn't modify upload dialog at all so I added fileuploaddlg2.zul to zkStyle/web/zul/html folder and changed setTemplate to Fileupload.setTemplate("~./zul/html/fileuploaddlg2.zul"). This time I got an error saying ~./zul/html/fileuploaddlg2.zul doesnt't exist.

我做错了什么?如何修改上传对话框的外观?

What am I doing wrong? how can I modify how the upload dialog look?

推荐答案

如果 URI 以 ~./ 开头,则 ZK 假定资源来自类路径.因此,您应该将模板文件移动到类路径.另一种选择(我认为你正在寻找的)是使用相对于 webapp 上下文根的 URI,在这种情况下不要使用 ~./ 前缀.

If an URI starting with ~./, ZK assumes the resource is from the class path. So you should move your template file to the class path. Another option (and I think the one you are looking for) is to use URI that is relative to the webapp context root, and in that case don't use ~./ prefix.

这篇关于ZK 上传对话框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆