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
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
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.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
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
Modifier and Type | Field and Description |
---|---|
protected com.webobjects.eocontrol.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
Constructor and Description |
---|
ERXArrayChooser(com.webobjects.appserver.WOContext aContext) |
Modifier and Type | Method and Description |
---|---|
String |
_destinationEntityName(boolean throwExceptionIfMissing) |
abstract NSArray |
currentValues() |
com.webobjects.eocontrol.EODataSource |
dataSource() |
String |
destinationDisplayKey() |
protected com.webobjects.eoaccess.EOEntity |
destinationEntity() |
String |
destinationEntityName() |
String |
destinationSortKey() |
protected NSArray |
destinationSortKeys() |
com.webobjects.eocontrol.EOEditingContext |
editingContext() |
boolean |
includeUnmatchedValues() |
boolean |
isBrowser() |
boolean |
isCheckBox() |
boolean |
isMandatory() |
boolean |
isPopup() |
boolean |
isRadio() |
protected abstract boolean |
isSingleSelection() |
protected void |
loadBindingsFromSelection()
I'm lazy.
|
boolean |
localizeDisplayKeys() |
String |
noneString() |
com.webobjects.eocontrol.EOQualifier |
qualifier() |
protected String |
realRelationshipKey() |
protected Object |
realSourceObject() |
String |
relationshipKey() |
void |
reset()
このメソッドは、指定されているコンテクストのオブジェクトに対する、
ステートレス・コンポーネントの一時的リファレンスをリセットもしくは削除します。
あるコンポーネントの共有化されたインスタンスが、他のセッションによって再利用されるとき、
このメソッドを利用し、各コンポーネントのインスタンス変数を解放します。
|
void |
setTheCurrentItem(Object aValue) |
boolean |
sortCaseInsensitive() |
String |
sourceEntityName() |
Object |
sourceObject() |
void |
takeValuesFromRequest(com.webobjects.appserver.WORequest r,
com.webobjects.appserver.WOContext c)
Calls
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.takeValuesFromRequest. |
Object |
theCurrentItem() |
Object |
theCurrentValue() |
NSArray |
theList() |
String |
uiStyle() |
NSArray |
unmatchedValues() |
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 com.webobjects.eocontrol.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(com.webobjects.appserver.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 com.webobjects.eocontrol.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 com.webobjects.eoaccess.EOEntity destinationEntity()
public String destinationEntityName()
public String _destinationEntityName(boolean throwExceptionIfMissing)
public String relationshipKey()
public Object sourceObject()
public String destinationDisplayKey()
public com.webobjects.eocontrol.EOQualifier qualifier()
public com.webobjects.eocontrol.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(com.webobjects.appserver.WORequest r, com.webobjects.appserver.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 – 2020 Project Wonder.