我需要在 ZK 中上传 csv 文件,这是我的 zul 页面:
<zk>
<window
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('UploadVM')"
title="win"
position="center"
mode="overlapped"
border="normal"
width="300px"
height="200px">
<button
label="upload"
upload="true,maxsize=801192"
onUpload="@command('uploadFile',upload=event)"
autodisable="self" />
</window>
</zk>
还有我的java页面:
public class UploadVM {
private Media media;
public Media getMedia(){
return media;
}
@NotifyChange("media")
@Command
public void uploadFile(@ContextParam(ContextType.TRIGGER_EVENT) UploadEvent event) {
media = event.getMedia();
media.getStreamData();
}
但是对于这个简单的例子,我有以下错误:
Use getStringData() instead
我不知道会发生什么。
谁能帮我???