| org.zkoss.zk.ui.HtmlBasedComponent org.zkoss.zul.Fileupload
Method Summary | |
public static Media | get() Opens a modal dialog with the default message and title,
and let user upload a file. | public static Media | get(boolean alwaysNative) Opens a modal dialog with the default message and title,
and let user upload a file.
Parameters: alwaysNative - whether to treat the uploaded file as binarystream, regardless its content type.If false (the default), it will convert toorg.zkoss.image.Image, org.zkoss.sound.Audio,binary stream, or text files depending on the content type. | public static Media | get(String message, String title) Opens a modal dialog with the specified message and title,
and let user upload a file.
Parameters: message - the message. | public static Media | get(String message, String title, boolean alwaysNative) Opens a modal dialog with the specified message and title,
and let user upload a file.
Parameters: message - the message. | public static Media[] | get(int max) Opens a modal dialog to upload mulitple files with
the default message and title.
Parameters: max - the maximal allowed number that an user can uploadat once. | public static Media[] | get(int max, boolean alwaysNative) Opens a modal dialog to upload mulitple files with
the default message and title.
Parameters: max - the maximal allowed number that an user can uploadat once. | public static Media[] | get(String message, String title, int max) Opens a modal dialog to upload multiple files with
the specified message and title.
The returned format depending on the content type.
Parameters: max - the maximal allowed number that an user can uploadat once. | public static Media[] | get(String message, String title, int max, boolean alwaysNative) Opens a modal dialog to upload multiple files with
the specified message, title and options.
Parameters: max - the maximal allowed number that an user can uploadat once. | public int | getNumber() Returns the maximal allowed number of files to upload. | public static String | getTemplate() Returns the template used to create the upload modal dialog. | public boolean | isChildable() No child is allowed. | public boolean | isNative() Returns whether to treat the uploaded file(s) as binary, i.e.,
not to convert it to image, audio or text files. | protected Object | newExtraCtrl() | public void | onClose() Hanldes the onClose event which is sent when file(s) is uploaded
or when the cancel button is pressed. | public void | setNative(boolean alwaysNative) Sets whether to treat the uploaded file(s) as binary, i.e.,
not to convert it to image, audio or text files. | public void | setNumber(int maxnum) Sets the maximal allowed number of files to upload. | public static void | setTemplate(String uri) Sets the template used to create the upload modal dialog. |
get | public static Media get() throws InterruptedException(Code) | | Opens a modal dialog with the default message and title,
and let user upload a file.
the uploaded content, or null if not uploaded. |
get | public static Media get(String message, String title) throws InterruptedException(Code) | | Opens a modal dialog with the specified message and title,
and let user upload a file.
Parameters: message - the message. If null, the default is used. Parameters: title - the title. If null, the default is used. the uploaded content, or null if not ready. |
get | public static Media get(String message, String title, boolean alwaysNative) throws InterruptedException(Code) | | Opens a modal dialog with the specified message and title,
and let user upload a file.
Parameters: message - the message. If null, the default is used. Parameters: title - the title. If null, the default is used. Parameters: alwaysNative - whether to treat the uploaded file as binarystream, regardless its content type.If false (the default), it will convert toorg.zkoss.image.Image, org.zkoss.sound.Audio,binary stream, or text files depending on the content type. the uploaded content, or null if not ready. since: 3.0.0 See Also: org.zkoss.zk.ui.util.Configuration.getUploadCharset See Also: org.zkoss.zk.ui.util.Configuration.getUploadCharsetFinder |
get | public static Media[] get(int max) throws InterruptedException(Code) | | Opens a modal dialog to upload mulitple files with
the default message and title.
Parameters: max - the maximal allowed number that an user can uploadat once. If nonpositive, 1 is assumed. an array of files that an users has uploaded,or null if uploaded. |
get | public static Media[] get(String message, String title, int max) throws InterruptedException(Code) | | Opens a modal dialog to upload multiple files with
the specified message and title.
The returned format depending on the content type.
Parameters: max - the maximal allowed number that an user can uploadat once. If nonpositive, 1 is assumed.If max is larger than 1000, 1000 is assumed. an array of files that an users has uploaded,or null if uploaded. |
get | public static Media[] get(String message, String title, int max, boolean alwaysNative) throws InterruptedException(Code) | | Opens a modal dialog to upload multiple files with
the specified message, title and options.
Parameters: max - the maximal allowed number that an user can uploadat once. If nonpositive, 1 is assumed.If max is larger than 1000, 1000 is assumed. Parameters: alwaysNative - whether to treat the uploaded files as binarystream, regardless its content type.If false (the default), it will convert toorg.zkoss.image.Image, org.zkoss.sound.Audio,binary stream, or text files depending on the content type. an array of files that an users has uploaded,or null if uploaded. since: 3.0.0 |
getNumber | public int getNumber()(Code) | | Returns the maximal allowed number of files to upload.
since: 2.4.0 |
getTemplate | public static String getTemplate()(Code) | | Returns the template used to create the upload modal dialog.
|
isChildable | public boolean isChildable()(Code) | | No child is allowed.
|
onClose | public void onClose()(Code) | | Hanldes the onClose event which is sent when file(s) is uploaded
or when the cancel button is pressed.
By default, it simply invalidates itself, i.e.,
all fields are cleared.
If you want to do something different, you can intercept the onClose
event.
since: 2.4.0 |
setNumber | public void setNumber(int maxnum) throws WrongValueException(Code) | | Sets the maximal allowed number of files to upload.
Default: 1.
Parameters: maxnum - the maximal allowed number (positive or negative).Since 3.0.2, the value can be negative, which means no limitation at all and the end user can uploadany numbers he wants (since 3.0.2) exception: WrongValueException - if non-positive, or it exceeds 1000 since: 2.4.0 |
setTemplate | public static void setTemplate(String uri)(Code) | | Sets the template used to create the upload modal dialog.
The template must follow the default template:
~./zul/html/fileuploaddlg.zul
In other words, just adjust the label and layout and don't
change the component's ID.
Note: the template has no effect, if you use
Fileupload as
a component (and embed it to a page).
|
|
|