| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
util.IEventListener --+
|
terminal.paintable.IPaintable --+
|
object --+ |
| |
terminal.variable_owner.IVariableOwner --+
|
object --+ |
| |
terminal.sizeable.ISizeable --+
|
component.IComponent --+
|
object --+ |
| |
event.method_event_source.IMethodEventSource --+
|
abstract_component.AbstractComponent --+
|
object --+ |
| |
util.IEventListener --+ |
| |
terminal.paintable.IPaintable --+ |
| |
object --+ | |
| | |
terminal.variable_owner.IVariableOwner --+ |
| |
object --+ | |
| | |
terminal.sizeable.ISizeable --+ |
| |
component.IComponent --+ |
| |
component.IFocusable --+
|
Upload
IComponent for uploading files from client to server.
The visible component consists of a file name input box and a browse button and an upload submit button to start uploading.
The Upload component needs a StringIO to write the uploaded data. You need to implement the upload.IReceiver interface and return the output stream in the receiveUpload() method.
You can get an event regarding starting (StartedEvent), progress (ProgressEvent), and finishing (FinishedEvent) of upload by implementing IStartedListener, IProgressListener, and IFinishedListener, respectively. The IFinishedListener is called for both failed and succeeded uploads. If you wish to separate between these two cases, you can use ISucceededListener (SucceededEvenet) and IFailedListener (FailedEvent).
The upload component does not itself show upload progress, but you can use the ProgressIndicator for providing progress feedback by implementing IProgressListener and updating the indicator in updateProgress().
Setting upload component immediate initiates the upload as soon as a file is selected, instead of the common pattern of file selection field and upload button.
Note! Because of browser dependent implementations of <input type="file"> element, setting size for Upload component is not supported. For some browsers setting size may work to some extent.
Version: 1.1.2
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
CLIENT_WIDGET = Nonehash(x) |
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Creates a new instance of Upload. The receiver must be set before performing an upload.
|
Invoked when the value of a variable has changed.
See Also:
|
Paints the content of this component.
|
Adds an event listener.
|
|
Removes an event listener.
|
|
Emits the progress event.
|
Returns the current receiver.
|
Sets the receiver.
|
Sets the focus for this component if the component is IFocusable.
|
Gets the Tabulator index of this IFocusable component.
See Also: IFocusable.getTabIndex |
Sets the Tabulator index of this IFocusable component.
See Also: IFocusable.setTabIndex |
Go into upload state. This is to prevent double uploading on same component. Warning: this is an internal method used by the framework and should not be used by user of the Upload component. Using it results in the Upload component going in wrong state and not working. It is currently public because it is used by another class. |
Interrupts the upload currently being received. The interruption will be done by the receiving tread so this method will return immediately and the actual interrupt will happen a bit later. |
Go into state where new uploading can begin. Warning: this is an internal method used by the framework and should not be used by user of the Upload component. |
Gets read bytes of the file currently being uploaded.
|
Returns size of file currently being uploaded. Value sane only during upload.
|
This method is deprecated, use addListener(IProgressListener) instead. Deprecated: Use addListener(IProgressListener) instead. |
This method is deprecated.
Deprecated: Replaced with addListener/removeListener |
|
In addition to the actual file chooser, upload components have button that starts actual upload progress. This method is used to set text in that button. In case the button text is set to null, the button is hidden. In this case developer must explicitly initiate the upload process with submitUpload. In case the Upload is used in immediate mode using setImmediate, the file choose (html input with type "file") is hidden and only the button with this text is shown. Note the string given is set as is to the button. HTML formatting is not stripped. Be sure to properly validate your value according to your needs.
|
Forces the upload the send selected file to the server. In case developer wants to use this feature, he/she will most probably want to hide the uploads internal submit button by setting its caption to null with setButtonCaption method. Note, that the upload runs asynchronous. Developer should use normal upload listeners to trac the process of upload. If the field is empty uploaded the file name will be empty string and file length 0 in the upload finished event. Also note, that the developer should not remove or modify the upload in the same user transaction where the upload submit is requested. The upload may safely be hidden or removed once the upload started event is fired. |
Requests that the paintable should be repainted as soon as possible.
|
Returns all listeners that are registered for the given event type or one of its subclasses.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sat Jul 6 19:33:00 2013 | http://epydoc.sourceforge.net |