PageRenderTime 19ms CodeModel.GetById 18ms app.highlight 0ms RepoModel.GetById 0ms app.codeStats 0ms

/webportal/src/main/webapp/WEB-INF/zul/upload.zul

http://alageospatialportal.googlecode.com/
Unknown | 26 lines | 24 code | 2 blank | 0 comment | 0 complexity | 82d7eb93cf4ac7e3174deb5e29e31354 MD5 | raw file
 1<?xml version="1.0" encoding="UTF-8"?>
 2
 3<zk xmlns="http://www.zkoss.org/2005/zul">
 4<window title="fileupload demo" border="normal">
 5    <div onUpload="processMedia(event.getMedias());">
 6    <zscript deferred="true"><![CDATA[
 7    import org.zkoss.util.media.Media;
 8
 9    public void processMedia(Media[] media) {
10    Messagebox.show("Processng...", "Error",
11                            Messagebox.OK, Messagebox.ERROR);
12        System.out.println("Loading files");
13        if (media != null) {
14            for (int i = 0; i < media.length; i++) {
15                if (media[i] instanceof org.zkoss.image.Image) {
16                    image.setContent(media[i]);
17                } else {
18                    Messagebox.show("Not an image: " + media[i], "Error",
19                            Messagebox.OK, Messagebox.ERROR);
20                    break; //not to show too many errors
21                }
22            }
23        } else {
24            Messagebox.show("No attachment", "Error",
25                            Messagebox.OK, Messagebox.ERROR);
26        }