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:
- WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, 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
- Author:
- ak (but most stuff is pulled over from the pre-existing WOToOne/WOToMany)
- See Also:
- Serialized Form
| Methods inherited from class er.extensions.components.ERXComponent |
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, appendToResponse, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, invokeAction, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript |
| Methods inherited from class com.webobjects.appserver.WOComponent |
__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, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding |
log
public static final 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 String NO_SELECTION_STRING
- See Also:
- Constant Field Values
NO_SORT_STRING
protected static final String NO_SORT_STRING
- See Also:
- Constant Field Values
_localizeDisplayKeys
protected Boolean _localizeDisplayKeys
_includeUnmatchedValues
protected Boolean _includeUnmatchedValues
_sortCaseInsensitive
protected Boolean _sortCaseInsensitive
_sourceEntityName
protected String _sourceEntityName
_destinationEntityName
protected String _destinationEntityName
_relationshipKey
protected String _relationshipKey
_sourceObject
protected Object _sourceObject
_destinationDisplayKey
protected String _destinationDisplayKey
_dataSource
protected EODataSource _dataSource
_uiStyle
protected String _uiStyle
_isMandatory
protected Boolean _isMandatory
_list
protected NSArray _list
_unmatchedValues
protected NSArray _unmatchedValues
_destinationSortKey
protected String _destinationSortKey
_noneString
protected String _noneString
theCurrentItem
protected Object theCurrentItem
ERXArrayChooser
public ERXArrayChooser(WOContext aContext)
isSingleSelection
protected abstract boolean isSingleSelection()
reset
public void reset()
- Overrides:
reset in class ERXStatelessComponent
noneString
public String noneString()
sortCaseInsensitive
public boolean sortCaseInsensitive()
localizeDisplayKeys
public boolean localizeDisplayKeys()
includeUnmatchedValues
public boolean includeUnmatchedValues()
sourceEntityName
public String sourceEntityName()
destinationSortKey
public String destinationSortKey()
unmatchedValues
public NSArray unmatchedValues()
destinationSortKeys
protected NSArray destinationSortKeys()
editingContext
protected 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 EOEntity destinationEntity()
destinationEntityName
public String destinationEntityName()
_destinationEntityName
public String _destinationEntityName(boolean throwExceptionIfMissing)
relationshipKey
public String relationshipKey()
sourceObject
public Object sourceObject()
destinationDisplayKey
public String destinationDisplayKey()
qualifier
public EOQualifier qualifier()
dataSource
public EODataSource dataSource()
uiStyle
public String uiStyle()
isMandatory
public boolean isMandatory()
isCheckBox
public boolean isCheckBox()
isRadio
public boolean isRadio()
isPopup
public boolean isPopup()
isBrowser
public boolean isBrowser()
theCurrentItem
public Object theCurrentItem()
setTheCurrentItem
public void setTheCurrentItem(Object aValue)
currentValues
public abstract NSArray currentValues()
theList
public NSArray theList()
theCurrentValue
public Object theCurrentValue()
takeValuesFromRequest
public void takeValuesFromRequest(WORequest r,
WOContext c)
- Description copied from class:
ERXComponent
- Calls _checkAccess prior to super.takeValuesFromRequest.
- Overrides:
takeValuesFromRequest in class ERXComponent
realSourceObject
protected Object realSourceObject()
realRelationshipKey
protected String realRelationshipKey()
Copyright © 2002 – 2007 Project Wonder.