Project Wonder 2.0

er.extensions
Class ERXArrayChooser

java.lang.Object
  extended bycom.webobjects.appserver.WOElement
      extended bycom.webobjects.appserver.WOComponent
          extended byer.extensions.ERXNonSynchronizingComponent
              extended byer.extensions.ERXStatelessComponent
                  extended byer.extensions.ERXArrayChooser
All Implemented Interfaces:
Cloneable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, WOActionResults
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.

Author:
ak (but most stuff is pulled over from the pre-existing WOToOne/WOToMany)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  EODataSource _dataSource
           
protected  String _destinationDisplayKey
           
protected  String _destinationEntityName
           
protected  String _destinationSortKey
           
protected  Boolean _isMandatory
           
protected  NSArray _list
           
protected  Boolean _localizeDisplayKeys
           
protected  String _noneString
           
protected  String _relationshipKey
           
protected  String _sourceEntityName
           
protected  Object _sourceObject
           
protected  String _uiStyle
           
static boolean localizeDisplayKeysDefault
           
static ERXLogger log
          logging support
protected static String NO_SELECTION_STRING
           
protected  Object theCurrentItem
           
 
Fields inherited from class er.extensions.ERXNonSynchronizingComponent
_dynamicBindings
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
_CLASS, NullValue
 
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.NSValidation
_CLASS
 
Constructor Summary
ERXArrayChooser(WOContext aContext)
           
 
Method Summary
 EODataSource dataSource()
           
 String destinationDisplayKey()
           
protected  EOEntity destinationEntity()
           
 String destinationEntityName()
           
 String destinationSortKey()
           
protected  NSArray destinationSortKeys()
           
protected  EOEditingContext editingContext()
           
 boolean isBrowser()
           
 boolean isCheckBox()
           
 boolean isMandatory()
           
 boolean isPopup()
           
 boolean isRadio()
           
protected abstract  boolean isSingleSelection()
           
 boolean localizeDisplayKeys()
           
 String noneString()
           
protected  String realRelationshipKey()
           
protected  Object realSourceObject()
           
 String relationshipKey()
           
 void reset()
           
 void setTheCurrentItem(Object aValue)
           
 String sourceEntityName()
           
 Object sourceObject()
           
 void takeValuesFromRequest(WORequest r, WOContext c)
           
 Object theCurrentItem()
           
 Object theCurrentValue()
           
 NSArray theList()
           
 String uiStyle()
           
 
Methods inherited from class er.extensions.ERXStatelessComponent
isStateless, valueForBooleanBinding, valueForBooleanBinding, valueForBooleanBinding, valueForIntBinding, valueForObjectBinding, valueForObjectBinding
 
Methods inherited from class er.extensions.ERXNonSynchronizingComponent
booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, dynamicBindings, intValueForBinding, localizer, objectValueForBinding, objectValueForBinding, stringValueForBinding, stringValueForBinding, synchronizesVariablesWithBindings
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _awakeInContext, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, appendToResponse, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, 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
 

Field Detail

log

public static final ERXLogger log
logging support


localizeDisplayKeysDefault

public static boolean localizeDisplayKeysDefault

NO_SELECTION_STRING

protected static final String NO_SELECTION_STRING
See Also:
Constant Field Values

_localizeDisplayKeys

protected Boolean _localizeDisplayKeys

_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

_destinationSortKey

protected String _destinationSortKey

_noneString

protected String _noneString

theCurrentItem

protected Object theCurrentItem
Constructor Detail

ERXArrayChooser

public ERXArrayChooser(WOContext aContext)
Method Detail

isSingleSelection

protected abstract boolean isSingleSelection()

reset

public void reset()
Overrides:
reset in class ERXStatelessComponent

noneString

public String noneString()

localizeDisplayKeys

public boolean localizeDisplayKeys()

sourceEntityName

public String sourceEntityName()

destinationSortKey

public String destinationSortKey()

destinationSortKeys

protected NSArray destinationSortKeys()

editingContext

protected EOEditingContext editingContext()

destinationEntity

protected EOEntity destinationEntity()

destinationEntityName

public String destinationEntityName()

relationshipKey

public String relationshipKey()

sourceObject

public Object sourceObject()

destinationDisplayKey

public String destinationDisplayKey()

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)

theList

public NSArray theList()

theCurrentValue

public Object theCurrentValue()

takeValuesFromRequest

public void takeValuesFromRequest(WORequest r,
                                  WOContext c)

realSourceObject

protected Object realSourceObject()

realRelationshipKey

protected String realRelationshipKey()

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.