er.extensions.components
Class ERXArrayChooser
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.extensions.components.ERXComponent
er.extensions.components.ERXNonSynchronizingComponent
er.extensions.components.ERXStatelessComponent
er.extensions.components.ERXArrayChooser
- 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:
- WOToManyRelationship, WOToOneRelationship
public abstract class ERXArrayChooser
- extends ERXStatelessComponent
This is an effort to consolidate the WOToOneRelationship, WOToManyRelationship and descendant components.
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
- See Also:
- Serialized Form
- Author:
- ak (but most stuff is pulled over from the pre-existing WOToOne/WOToMany)
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 |
ERXArrayChooser(com.webobjects.appserver.WOContext aContext)
|
Methods inherited from class er.extensions.components.ERXComponent |
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript |
Methods inherited from class com.webobjects.appserver.WOComponent |
_associationWithName, _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, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, 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 |
log
public static final org.apache.log4j.Logger log
- logging support
localizeDisplayKeysDefault
public static boolean localizeDisplayKeysDefault
includeUnmatchedValuesDefault
public static boolean includeUnmatchedValuesDefault
sortCaseInsensitiveDefault
public static boolean sortCaseInsensitiveDefault
NO_SELECTION_STRING
protected static final java.lang.String NO_SELECTION_STRING
- See Also:
- Constant Field Values
NO_SORT_STRING
protected static final java.lang.String NO_SORT_STRING
- See Also:
- Constant Field Values
_localizeDisplayKeys
protected java.lang.Boolean _localizeDisplayKeys
_includeUnmatchedValues
protected java.lang.Boolean _includeUnmatchedValues
_sortCaseInsensitive
protected java.lang.Boolean _sortCaseInsensitive
_sourceEntityName
protected java.lang.String _sourceEntityName
_destinationEntityName
protected java.lang.String _destinationEntityName
_relationshipKey
protected java.lang.String _relationshipKey
_sourceObject
protected java.lang.Object _sourceObject
_destinationDisplayKey
protected java.lang.String _destinationDisplayKey
_dataSource
protected com.webobjects.eocontrol.EODataSource _dataSource
_uiStyle
protected java.lang.String _uiStyle
_isMandatory
protected java.lang.Boolean _isMandatory
_list
protected com.webobjects.foundation.NSArray _list
_unmatchedValues
protected com.webobjects.foundation.NSArray _unmatchedValues
_destinationSortKey
protected java.lang.String _destinationSortKey
_noneString
protected java.lang.String _noneString
theCurrentItem
protected java.lang.Object theCurrentItem
ERXArrayChooser
public ERXArrayChooser(com.webobjects.appserver.WOContext aContext)
isSingleSelection
protected abstract boolean isSingleSelection()
reset
public void reset()
- Overrides:
reset
in class ERXStatelessComponent
noneString
public java.lang.String noneString()
sortCaseInsensitive
public boolean sortCaseInsensitive()
localizeDisplayKeys
public boolean localizeDisplayKeys()
includeUnmatchedValues
public boolean includeUnmatchedValues()
sourceEntityName
public java.lang.String sourceEntityName()
destinationSortKey
public java.lang.String destinationSortKey()
unmatchedValues
public com.webobjects.foundation.NSArray unmatchedValues()
destinationSortKeys
protected com.webobjects.foundation.NSArray destinationSortKeys()
editingContext
public com.webobjects.eocontrol.EOEditingContext editingContext()
loadBindingsFromSelection
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".
destinationEntity
protected com.webobjects.eoaccess.EOEntity destinationEntity()
destinationEntityName
public java.lang.String destinationEntityName()
_destinationEntityName
public java.lang.String _destinationEntityName(boolean throwExceptionIfMissing)
relationshipKey
public java.lang.String relationshipKey()
sourceObject
public java.lang.Object sourceObject()
destinationDisplayKey
public java.lang.String destinationDisplayKey()
qualifier
public com.webobjects.eocontrol.EOQualifier qualifier()
dataSource
public com.webobjects.eocontrol.EODataSource dataSource()
uiStyle
public java.lang.String uiStyle()
isMandatory
public boolean isMandatory()
isCheckBox
public boolean isCheckBox()
isRadio
public boolean isRadio()
isPopup
public boolean isPopup()
isBrowser
public boolean isBrowser()
theCurrentItem
public java.lang.Object theCurrentItem()
setTheCurrentItem
public void setTheCurrentItem(java.lang.Object aValue)
currentValues
public abstract com.webobjects.foundation.NSArray currentValues()
theList
public com.webobjects.foundation.NSArray theList()
theCurrentValue
public java.lang.Object theCurrentValue()
takeValuesFromRequest
public void takeValuesFromRequest(com.webobjects.appserver.WORequest r,
com.webobjects.appserver.WOContext c)
- Description copied from class:
ERXNonSynchronizingComponent
- Calls
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent()
prior to super.takeValuesFromRequest.
- Overrides:
takeValuesFromRequest
in class ERXNonSynchronizingComponent
- Parameters:
r
- from which the values will be takenc
- of the request
realSourceObject
protected java.lang.Object realSourceObject()
realRelationshipKey
protected java.lang.String realRelationshipKey()
Copyright © 2002 – 2007 Project Wonder.