public abstract class ERXArrayChooser extends ERXStatelessComponent
As most of the code between the two is shared anyway, it makes sense to provide a base class and only handle the differences in the descendants. One core difference if that this component can handle POJOs both as the source and the destination objects. You can't instantiate one of these yourself.
This class can handle to-one, to-many and simple attribute selections. You can can set the list via possibleChoices, dataSource, destinationEntityName or via sourceEntityName and relationshipKey.
The main difference between this component and the former WOToOne/WOToMany is that it is non-synchronizing. So if you have custom subclasses of WOToOne/WOToMany you need to take this into account. Also adds the values that are not included in the restricted-choice list. These items are marked by [name of item]. This should ensure they end up at the bottom of the list. You can also specify the editingContext the component uses to fetch the related objects into. NOTE: currently "includeUnmatchedValues" is set to false
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
Modifier and Type | Field and Description |
---|---|
protected EODataSource |
_dataSource |
protected String |
_destinationDisplayKey |
protected String |
_destinationEntityName |
protected String |
_destinationSortKey |
protected Boolean |
_includeUnmatchedValues |
protected Boolean |
_isMandatory |
protected NSArray |
_list |
protected Boolean |
_localizeDisplayKeys |
protected String |
_noneString |
protected String |
_relationshipKey |
protected Boolean |
_sortCaseInsensitive |
protected String |
_sourceEntityName |
protected Object |
_sourceObject |
protected String |
_uiStyle |
protected NSArray |
_unmatchedValues |
static boolean |
includeUnmatchedValuesDefault |
static boolean |
localizeDisplayKeysDefault |
protected static String |
NO_SELECTION_STRING |
protected static String |
NO_SORT_STRING |
static boolean |
sortCaseInsensitiveDefault |
protected Object |
theCurrentItem |
_dynamicBindings
_Extension, _IsEventLoggingEnabled, _keyAssociations
_CLASS
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
NullValue
_CLASS
Constructor and Description |
---|
ERXArrayChooser(WOContext aContext) |
isStateless
appendToResponse, invokeAction, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, arrayValueForBinding, arrayValueForBinding, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, browser, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, 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, 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 static boolean localizeDisplayKeysDefault
public static boolean includeUnmatchedValuesDefault
public static boolean sortCaseInsensitiveDefault
protected static final String NO_SELECTION_STRING
protected static final String NO_SORT_STRING
protected Boolean _localizeDisplayKeys
protected Boolean _includeUnmatchedValues
protected Boolean _sortCaseInsensitive
protected String _sourceEntityName
protected String _destinationEntityName
protected String _relationshipKey
protected Object _sourceObject
protected String _destinationDisplayKey
protected EODataSource _dataSource
protected String _uiStyle
protected Boolean _isMandatory
protected NSArray _list
protected NSArray _unmatchedValues
protected String _destinationSortKey
protected String _noneString
protected Object theCurrentItem
public ERXArrayChooser(WOContext aContext)
protected abstract boolean isSingleSelection()
public void reset()
ERXComponent
reset
in class ERXStatelessComponent
public String noneString()
public boolean sortCaseInsensitive()
public boolean localizeDisplayKeys()
public boolean includeUnmatchedValues()
public String sourceEntityName()
public String destinationSortKey()
public NSArray unmatchedValues()
protected NSArray destinationSortKeys()
public EOEditingContext editingContext()
protected void loadBindingsFromSelection()
I'm lazy. I don't want to bind sourceObject, sourceEntityName, and relationshipKey. Work it out, Wonder, that's what I say. So if you bind, for instance:
selection = person.company;
... it will figure out that the sourceObject is "person", the relationshipKey is "company" and the sourceEntityName is "Person".
protected EOEntity destinationEntity()
public String destinationEntityName()
public String _destinationEntityName(boolean throwExceptionIfMissing)
public String relationshipKey()
public Object sourceObject()
public String destinationDisplayKey()
public EOQualifier qualifier()
public EODataSource dataSource()
public String uiStyle()
public boolean isMandatory()
public boolean isCheckBox()
public boolean isRadio()
public boolean isPopup()
public boolean isBrowser()
public Object theCurrentItem()
public void setTheCurrentItem(Object aValue)
public abstract NSArray currentValues()
public NSArray theList()
public Object theCurrentValue()
public void takeValuesFromRequest(WORequest r, WOContext c)
ERXNonSynchronizingComponent
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent()
prior to super.takeValuesFromRequest.takeValuesFromRequest
in class ERXNonSynchronizingComponent
r
- from which the values will be takenc
- of the requestprotected Object realSourceObject()
protected String realRelationshipKey()
Copyright © 2002 – 2024 Project Wonder.