Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have a best example <code>dropupload</code> for uploading <code>csv</code> file,i thing it will help you for better understanding.</p> <p>index.zul</p> <pre><code>&lt;?page title="Auto Generated index.zul"?&gt; &lt;window title="Drop here" border="normal" width="100%" height="100%" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.demo.DropFileViewModel')"&gt; &lt;dropupload maxsize="5120" detection="none" onUpload="@command('doUpload')"&gt; &lt;/dropupload&gt; &lt;button label="Download" onClick="@command('doDownload')"&gt;&lt;/button&gt; &lt;/window&gt; </code></pre> <p>DropFileViewModel.java</p> <pre><code>package com.demo; import org.zkoss.bind.BindContext; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.ContextParam; import org.zkoss.bind.annotation.ContextType; import org.zkoss.util.media.Media; import org.zkoss.zhtml.Filedownload; import org.zkoss.zk.ui.event.UploadEvent; import org.zkoss.zul.Messagebox; public class DropFileViewModel { Media media; @Command public void doUpload(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { UploadEvent upEvent = null; Object objUploadEvent = ctx.getTriggerEvent(); if (objUploadEvent != null &amp;&amp; (objUploadEvent instanceof UploadEvent)) { upEvent = (UploadEvent) objUploadEvent; } if (upEvent != null) { media = upEvent.getMedia(); Messagebox.show("File Uploaded: " + media.getName()); } } @Command public void doDownload() { if (media != null) Filedownload.save(media); else Messagebox.show("First Drop Your File"); } } </code></pre> <p><a href="http://corejavaexample.blogspot.in/2013/06/how-to-drop-your-file-using-dropupload.html" rel="nofollow">check here</a></p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload