You can use button component on zul page with upload feature enabled, and listen to onUpload event.
vincentjian ( 2015-08-13 09:03:26 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a code as below: file "upload.zul"
<div id="S7" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.fileupload.FileUploadController')" >
<html>
<![CDATA[
<div onload=init()>
<form method="post" enctype="multipart/form-data">
<input type="file" id="uploadPath" onChange="doChange()" width="100%"/>
</form>
</div>
<script>
function doChange() {
zAu.send(new zk.Event(zk.Widget.$('$lFilePath'), 'onJSChange', jq("#uploadPath").val()));
}
</script>
]]>
</html>
<div id="lFilePath">
</div>
</div>
I want upload file to server Please, help me Thanks
Currently the above code, I have call handling and get filenames file FileUploadController.java
@Command
@Listen("onJSChange=#lFilePath")
public void onJSChange(Event event) {
System.out.println(event.getData());
}
Hello HuySeven,
I will propose something different:
http://books.zkoss.org/wiki/ZKComponentReference/EssentialComponents/Button#FileUpload
http://books.zkoss.org/wiki/ZKComponentReference/Essential_Components/Fileupload
http://www.codejava.net/java-se/networking/upload-files-by-sending-multipart-request-programmatically
Best Regards,
Darksu
Thank you Darksu, But I want to upload by Zul file as I described
You can use button component on zul page with upload feature enabled, and listen to onUpload event.
vincentjian ( 2015-08-13 09:03:26 +0800 )editAsked: 2015-07-01 13:55:48 +0800
Seen: 39 times
Last updated: Jul 06 '15
ZK 7.0.3 doAfterCompose is not called for GenericForwardComposer
Power of ZK Calender With Charts 2 and Other Components
ZK7 atlantic theme: vlayout/hlayout spacing
Structuring zul-code without includes?
css zk 7.0.3 with ie9 not work
Change listbox MVVM template with Java or how to let user change column order