|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.LabelElement
org.zkoss.zul.impl.LabelImageElement
org.zkoss.zul.Button
org.zkoss.zul.Fileupload
public class Fileupload
A fileupload dialog used to let user upload a file.
There are two ways to use Fileupload
:
You don't create Fileupload
directly. Rather, use get()
or get(String, String)
.
You can create it as a component and then listen to
the onUpload event (UploadEvent
).
A non-XUL extension.
Filedownload
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class org.zkoss.zul.impl.LabelImageElement |
---|
LabelImageElement.ExtraCtrl |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zul.Button |
---|
_upload |
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_height, _left, _top, _width, _zclass |
Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
_visible |
Fields inherited from interface org.zkoss.zk.ui.Component |
---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
Constructor Summary | |
---|---|
Fileupload()
|
|
Fileupload(java.lang.String label)
|
|
Fileupload(java.lang.String label,
java.lang.String image)
|
Method Summary | |
---|---|
static Media |
get()
Opens a modal dialog with the default message and title, and let user upload a file. |
static Media |
get(boolean alwaysNative)
Opens a modal dialog with the default message and title, and let user upload a file. |
static Media[] |
get(int max)
Opens a modal dialog to upload mulitple files with the default message and title. |
static Media[] |
get(int max,
boolean alwaysNative)
Opens a modal dialog to upload mulitple files with the default message and title. |
static Media |
get(java.lang.String message,
java.lang.String title)
Opens a modal dialog with the specified message and title, and let user upload a file. |
static Media |
get(java.lang.String message,
java.lang.String title,
boolean alwaysNative)
Opens a modal dialog with the specified message and title, and let user upload a file. |
static Media[] |
get(java.lang.String message,
java.lang.String title,
int max)
Opens a modal dialog to upload multiple files with the specified message and title. |
static Media[] |
get(java.lang.String message,
java.lang.String title,
int max,
boolean alwaysNative)
Opens a modal dialog to upload multiple files with the specified message, title and options. |
static Media[] |
get(java.lang.String message,
java.lang.String title,
int max,
int maxsize,
boolean alwaysNative)
Opens a modal dialog to upload multiple files with the specified message, title and options. |
int |
getMaxsize()
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
int |
getNumber()
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
static java.lang.String |
getTemplate()
Returns the template used to create the upload modal dialog. |
boolean |
isNative()
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
void |
setMaxsize(int maxsize)
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
void |
setNative(boolean alwaysNative)
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
void |
setNumber(int maxnum)
Deprecated. As of release 5.0.0, replaced with Button.setUpload(String) |
static void |
setTemplate(java.lang.String uri)
Sets the template used to create the upload modal dialog. |
Methods inherited from class org.zkoss.zul.Button |
---|
getAutodisable, getDir, getHref, getOrient, getTabindex, getTarget, getUpload, getZclass, isChildable, isDisabled, renderProperties, setAutodisable, setDir, setDisabled, setHref, setOrient, setTabindex, setTarget, setUpload |
Methods inherited from class org.zkoss.zul.impl.LabelImageElement |
---|
getHoverImage, getImage, getImageContent, getSrc, isImageAssigned, newExtraCtrl, setHoverImage, setHoverImageContent, setHoverImageContent, setImage, setImageContent, setImageContent, setSrc |
Methods inherited from class org.zkoss.zul.impl.LabelElement |
---|
getLabel, setLabel |
Methods inherited from class org.zkoss.zul.impl.XulElement |
---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, service, setClass, setDraggable, setDroppable, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, setWidth, setZclass, setZindex, setZIndex |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
Methods inherited from interface org.zkoss.zk.ui.ext.Scope |
---|
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute |
Methods inherited from interface org.zkoss.zul.impl.api.LabelImageElement |
---|
getHoverImage, getImage, getImageContent, setHoverImage, setHoverImageContent, setHoverImageContent, setImage, setImageContent, setImageContent |
Methods inherited from interface org.zkoss.zul.impl.api.LabelElement |
---|
getLabel, setLabel |
Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Constructor Detail |
---|
public Fileupload()
public Fileupload(java.lang.String label)
public Fileupload(java.lang.String label, java.lang.String image)
Method Detail |
---|
public int getMaxsize()
Button.setUpload(String)
public void setMaxsize(int maxsize)
Button.setUpload(String)
public int getNumber()
Button.setUpload(String)
Fileupload
getNumber
in interface Fileupload
public void setNumber(int maxnum) throws WrongValueException
Button.setUpload(String)
Fileupload
Default: 1.
setNumber
in interface Fileupload
maxnum
- the maximal allowed number (positive or negative). The value can be negative, which means no limitation at
all and the end user can upload any numbers he wants
WrongValueException
- if non-positive, or it exceeds 1000public boolean isNative()
Button.setUpload(String)
Fileupload
Default: false.
isNative
in interface Fileupload
Configuration.getUploadCharset()
,
Configuration.getUploadCharsetFinder()
public void setNative(boolean alwaysNative)
Button.setUpload(String)
Fileupload
setNative
in interface Fileupload
alwaysNative
- whether to treat the uploaded file as binary stream,
regardless its content type. If false (the default), it will
convert to Image
,
Audio
, binary stream, or text files
depending on the content type.Configuration.setUploadCharset(java.lang.String)
,
Configuration.setUploadCharsetFinder(org.zkoss.zk.ui.util.CharsetFinder)
public static Media get() throws java.lang.InterruptedException
java.lang.InterruptedException
public static Media get(boolean alwaysNative) throws java.lang.InterruptedException
alwaysNative
- whether to treat the uploaded file as binary
stream, regardless its content type.
If false (the default), it will convert to
Image
, Audio
,
binary stream, or text files depending on the content type.
java.lang.InterruptedException
Configuration.getUploadCharset()
,
Configuration.getUploadCharsetFinder()
public static Media get(java.lang.String message, java.lang.String title) throws java.lang.InterruptedException
message
- the message. If null, the default is used.title
- the title. If null, the default is used.
java.lang.InterruptedException
public static Media get(java.lang.String message, java.lang.String title, boolean alwaysNative) throws java.lang.InterruptedException
message
- the message. If null, the default is used.title
- the title. If null, the default is used.alwaysNative
- whether to treat the uploaded file as binary
stream, regardless its content type.
If false (the default), it will convert to
Image
, Audio
,
binary stream, or text files depending on the content type.
java.lang.InterruptedException
Configuration.getUploadCharset()
,
Configuration.getUploadCharsetFinder()
public static Media[] get(int max) throws java.lang.InterruptedException
max
- the maximal allowed number that an user can upload
at once. If nonpositive, 1 is assumed.
java.lang.InterruptedException
public static Media[] get(int max, boolean alwaysNative) throws java.lang.InterruptedException
max
- the maximal allowed number that an user can upload
at once. If nonpositive, 1 is assumed.alwaysNative
- whether to treat the uploaded files as binary
stream, regardless its content type.
If false (the default), it will convert to
Image
, Audio
,
binary stream, or text files depending on the content type.
java.lang.InterruptedException
Configuration.getUploadCharset()
,
Configuration.getUploadCharsetFinder()
public static Media[] get(java.lang.String message, java.lang.String title, int max) throws java.lang.InterruptedException
The returned format depending on the content type.
max
- the maximal allowed number that an user can upload
at once. If nonpositive, 1 is assumed.
If max is larger than 1000, 1000 is assumed.
java.lang.InterruptedException
public static Media[] get(java.lang.String message, java.lang.String title, int max, boolean alwaysNative) throws java.lang.InterruptedException
max
- the maximal allowed number that an user can upload
at once. If nonpositive, 1 is assumed.
If max is larger than 1000, 1000 is assumed.alwaysNative
- whether to treat the uploaded files as binary
stream, regardless its content type.
If false (the default), it will convert to
Image
, Audio
,
binary stream, or text files depending on the content type.
java.lang.InterruptedException
public static Media[] get(java.lang.String message, java.lang.String title, int max, int maxsize, boolean alwaysNative) throws java.lang.InterruptedException
max
- the maximal allowed number that an user can upload
at once. If nonpositive, 1 is assumed.
If max is larger than 1000, 1000 is assumed.maxsize
- the maximal upload size of the component.alwaysNative
- whether to treat the uploaded files as binary
stream, regardless its content type.
If false (the default), it will convert to
Image
, Audio
,
binary stream, or text files depending on the content type.
java.lang.InterruptedException
public static void setTemplate(java.lang.String uri)
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).
public static java.lang.String getTemplate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |