org.zkoss.zul.api
Interface Fileupload

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, Scope, java.io.Serializable
All Known Implementing Classes:
Fileupload, Fileupload

public interface Fileupload
extends HtmlBasedComponent

A fileupload dialog used to let user upload a file.

There are two ways to use Fileupload:

1. Open as a modal dialog:

You don't create Fileupload directly. Rather, use Fileupload.get() or Fileupload.get(String, String).

2. Embed as part of the page:

You can create it as a component and then listen to the onUpload event ( UploadEvent). If the cancel button is pressed or file(s) is uploaded,

A non-XUL extension.

Since:
3.5.2
Author:
tomyeh
See Also:
Filedownload

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 int getNumber()
          Returns the maximal allowed number of files to upload.
 boolean isNative()
          Returns whether to treat the uploaded file(s) as binary, i.e., not to convert it to image, audio or text files.
 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.
 void setNumber(int maxnum)
          Sets the maximal allowed number of files to upload.
 
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.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

getNumber

int getNumber()
Returns the maximal allowed number of files to upload.


setNumber

void setNumber(int maxnum)
               throws WrongValueException
Sets the maximal allowed number of files to upload.

Default: 1.

Parameters:
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
Throws:
WrongValueException - if non-positive, or it exceeds 1000

isNative

boolean isNative()
Returns whether to treat the uploaded file(s) as binary, i.e., not to convert it to image, audio or text files.

Default: false.

See Also:
Configuration.getUploadCharset(), Configuration.getUploadCharsetFinder()

setNative

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.

Parameters:
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.
See Also:
Configuration.setUploadCharset(java.lang.String), Configuration.setUploadCharsetFinder(org.zkoss.zk.ui.util.CharsetFinder)


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo