public class ERDragAndDropUpload extends ERXNonSynchronizingComponent
If you want to include a file selector to the drop-area, then either
use includeFileSelector or add one in another location as:
<wo:genericContainer elementName = "input" type = "file" id = "fileSelectorID" multiple = "multiple" />
and bind fileSelectorID to the id.
If you just want a file selector button without the drop area, then
use this component with no content and includeFileSelector set to true.
This version also uses a fix from Michael Kondratov for the completeAllFunction in dndupload.js. completeAllFunction now works as advertised.
Name | Description |
---|---|
accept | an array of accepted mimetypes. If no mimetypes are specified, all are accepted. ex. (image/png, image/jpg, text/*) |
action | the action to fire when an attachment is uploaded |
attachment | the uploaded attachment |
completeAllFunction | a javascript function to execute when all dropped files are processed |
completeFunction | a javascript function to execute after each uploaded file is processed. This function accepts two args. The first is the event. The second is the file. |
configurationName | the configuration name. See the package javadocs for more info. |
disabled | if true, the upload component is disabled and only displays component content |
editingContext | the editing context where the ERAttachments will be created |
enterFunction | a javascript function to execute when dragged files enter the drop target |
errorFunction | a javascript function to execute when a file upload error occurs. This function accepts two args. The first is the event. The second is the file. |
exitFunction | a javascript function to execute when dragged files exit the drop target |
overFunction | a javascript function to execute when dragged files are over the drop target |
storageType | the ERAttachment storage type (db, file, s3, cf, ...) |
includeFileSelector | a file selector appears at the top of the drag-area. |
fileSelectorID | include an id to a file selector outside of the component. Can be used if more custom file selector behavior is needed. |
WOComponent._EventLoggingEnabler, WOComponent.Event
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
_dynamicBindings
_Extension, _IsEventLoggingEnabled, _keyAssociations
_CLASS
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
NullValue
_CLASS
Constructor and Description |
---|
ERDragAndDropUpload(WOContext context) |
Modifier and Type | Method and Description |
---|---|
protected String |
_frameworkName()
Returns the name of this component's framework or "app" if
frameworkName() returns null.
|
NSArray<String> |
accept() |
boolean |
acceptMimetype(String mimetype) |
protected NSArray<String> |
additionalJavascriptFiles()
Returns an array of additional Javascript files for this component, or
null (or empty array) if there aren't any.
|
String |
configurationName()
The ERAttachment configuration name for the uploaded files.
|
String |
dropTargetID() |
EOEditingContext |
editingContext()
The EOEditingContext where the ERAttachment will be created
|
String |
fileSelectorID() |
WOActionResults |
invokeAction(WORequest request,
WOContext context)
Calls
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.invokeAction. |
String |
postURL()
The ajax request URL for this component.
|
String |
storageType()
The ERAttachment storage type for the uploaded files.
|
void |
takeValuesFromRequest(WORequest request,
WOContext context)
Calls
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.takeValuesFromRequest. |
appendToResponse, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings
_awakeInContext, _checkAccess, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, arrayValueForBinding, arrayValueForBinding, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, browser, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, reset, shouldCheckAccess, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript
__valueForBinding, _associationWithName, _childTemplate, _cleanUpStatelessComponent, _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, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, setVariableValueForName, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding, variableValueForName, variableWithName
public ERDragAndDropUpload(WOContext context)
public String dropTargetID()
public String fileSelectorID()
protected NSArray<String> additionalJavascriptFiles()
ERXComponent
additionalJavascriptFiles
in class ERXComponent
protected String _frameworkName()
ERXComponent
_frameworkName
in class ERXComponent
public String postURL()
public WOActionResults invokeAction(WORequest request, WOContext context)
ERXNonSynchronizingComponent
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent()
prior to super.invokeAction.invokeAction
in class ERXNonSynchronizingComponent
request
- for which the action is invokedcontext
- of the requestpublic void takeValuesFromRequest(WORequest request, WOContext context)
ERXNonSynchronizingComponent
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent()
prior to super.takeValuesFromRequest.takeValuesFromRequest
in class ERXNonSynchronizingComponent
request
- from which the values will be takencontext
- of the requestpublic String storageType()
public String configurationName()
public EOEditingContext editingContext()
public boolean acceptMimetype(String mimetype)
Copyright © 2002 – 2024 Project Wonder.