er.ajax
Class AjaxFileUpload
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.ajax.AjaxFileUpload
- All Implemented Interfaces:
- com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- AjaxFlexibleFileUpload
public class AjaxFileUpload
- extends com.webobjects.appserver.WOComponent
AjaxFileUpload provides an Ajax wrapper around the file upload process. This works pretty differently than
WOFileUpload. The AjaxFileUpload component itself provides its own form and autosubmits when the user selects a file
to upload. The upload runs in a hidden iframe, with Ajax updates occurring in the main window. When the final ajax
update occurs after the completion of the upload, the appropriate actions fire. This means that if the user navigates
away during the upload, no completion/failure/etc notifications will occur.
- See Also:
- Serialized Form
- Author:
- mschrag
Bindings |
cancelText | the text to display for the cancel link |
cancelingText | the text to display when the progress is being canceled |
startingText | the text to display when the progress is starting |
startedFunction | the javascript function to execute when the progress is started |
canceledFunction | the javascript function to execute when the upload is canceled |
succeededFunction | the javascript function to execute when the upload succeeds |
failedFunction | the javascript function to execute when the upload fails |
finishedFunction | the javascript function to execute when the upload finishes (succeeded, failed, or
canceled) |
finishedAction | the action to fire when the upload finishes (cancel, failed, or succeeded) |
canceledAction | the action to fire when the upload is canceled |
succeededAction | the action to fire when the upload succeeded |
failedAction | the action to fire when the upload fails |
data | the NSData that will be bound with the contents of the upload |
inputStream | will be bound to an input stream on the contents of the upload |
outputStream | the output stream to write the contents of the upload to |
streamToFilePath | the path to write the upload to, can be a directory |
finalFilePath | the final file path of the upload (when streamToFilePath is set or keepTempFile = true) |
filePath | the name of the uploaded file |
allowCancel | if true, the cancel link is visible |
progressBarBeforeStart | if true, the progress bar is visible before the upload is started |
progressBarAfterDone | if true, the progress bar is visible after the upload is done |
refreshTime | the number of milliseconds to wait between refreshes |
keepTempFile | if true, don't delete the temp file that AjaxFileUpload creates |
uploadLabel | the label to display on the Upload button ("Upload" by default) |
uploadFunctionName | the upload button will instead be a function with the given name |
progressOfText | the text to display for the word "of" in the "[size] of [totalsize]" string during upload |
mimeType | set from the content-type of the upload header if available |
class | the class attribute of the file input |
style | the style attribute of the file input |
id | the id attribute of the file input |
onFileSelected | optional JS code that is called when the file selection changes. To auto-start the upload when
a file is selected, set uploadFunctionName to e.g. "startUpload" and onFileSelected to "startUpload()" |
uploadProgress | access to the underlying AjaxUploadProgress object |
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent |
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation |
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException |
Fields inherited from class com.webobjects.appserver.WOComponent |
_Extension, _IsEventLoggingEnabled, _keyAssociations |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
_CLASS |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
NullValue |
Fields inherited from interface com.webobjects.foundation.NSValidation |
_CLASS |
Constructor Summary |
AjaxFileUpload(com.webobjects.appserver.WOContext context)
|
Methods inherited from class com.webobjects.appserver.WOComponent |
_associationWithName, _awakeInContext, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_uploadStarted
protected boolean _uploadStarted
_progress
protected AjaxUploadProgress _progress
_triggerUploadStart
protected boolean _triggerUploadStart
AjaxFileUpload
public AjaxFileUpload(com.webobjects.appserver.WOContext context)
setRequestHandlerKey
public void setRequestHandlerKey(java.lang.String requestHandlerKey)
requestHandlerKey
public java.lang.String requestHandlerKey()
appendToResponse
public void appendToResponse(com.webobjects.appserver.WOResponse aResponse,
com.webobjects.appserver.WOContext aContext)
- Overrides:
appendToResponse
in class com.webobjects.appserver.WOComponent
synchronizesVariablesWithBindings
public boolean synchronizesVariablesWithBindings()
- Overrides:
synchronizesVariablesWithBindings
in class com.webobjects.appserver.WOComponent
uploadLabel
public java.lang.String uploadLabel()
progressBarBeforeStart
public boolean progressBarBeforeStart()
progressBarAfterDone
public boolean progressBarAfterDone()
setUploadProgress
public void setUploadProgress(AjaxUploadProgress progress)
uploadProgress
public AjaxUploadProgress uploadProgress()
id
public java.lang.String id()
uploadUrl
public java.lang.String uploadUrl()
bytesReadSize
public java.lang.String bytesReadSize()
streamLengthSize
public java.lang.String streamLengthSize()
uploadFrameName
public java.lang.String uploadFrameName()
startUploadName
public java.lang.String startUploadName()
startUploadFunctionCall
public java.lang.String startUploadFunctionCall()
triggerStartUpload
public boolean triggerStartUpload()
uploadFormID
public java.lang.String uploadFormID()
progressBarID
public java.lang.String progressBarID()
startingText
public java.lang.String startingText()
cancelText
public java.lang.String cancelText()
cancelingText
public java.lang.String cancelingText()
startUpload
public com.webobjects.appserver.WOActionResults startUpload()
isUploadStarted
public boolean isUploadStarted()
uploadFinished
public void uploadFinished()
uploadCanceled
public com.webobjects.appserver.WOActionResults uploadCanceled()
uploadSucceeded
public com.webobjects.appserver.WOActionResults uploadSucceeded()
uploadFailed
public com.webobjects.appserver.WOActionResults uploadFailed()
srcUrl
public java.lang.String srcUrl()
Copyright © 2002 – 2007 Project Wonder.