0
在我ZUL我使用:爲什麼不在ZK中運行上傳命令?
<cell colspan="2">
<button label="Upload image" upload="true" onUpload="@command('uploadImage', uploadEvent=event, window = editTranslation)"/>
</cell>
而且在視圖模型我用這個:
@Command
@NotifyChange({"leadImage", "uploadMessage"})
public void uploadImage(@BindingParam("uploadEvent") UploadEvent event, @BindingParam("window") Window win) {
Clients.showBusy(win, "Képfeldolgozás ...");
System.err.println("uploadimage");
Media media = event.getMedia();
if (media instanceof org.zkoss.image.Image) {
saveImageToDisk(media);
Clients.clearBusy(win);
} else {
Clients.clearBusy(win);
Messagebox.show("Ez nem egy kép: "+media, "Error", Messagebox.OK, Messagebox.ERROR);
}
}
但是不會運行uploadImage命令,如果我按一下按鈕,然後選擇圖像...它表明:例如C:\ fakepath \ desert.png ...什麼是問題?我使用彈簧安全可以導致這種情況嗎?