ERXArrayChooser Class Reference

Inherits er::extensions::components::ERXStatelessComponent.

Inherited by WOToManyRelationship, and WOToOneRelationship.

Collaboration diagram for ERXArrayChooser:

Collaboration graph
[legend]

List of all members.

Public Member Functions

String _destinationEntityName (boolean throwExceptionIfMissing)
abstract NSArray currentValues ()
EODataSource dataSource ()
String destinationDisplayKey ()
String destinationEntityName ()
String destinationSortKey ()
EOEditingContext editingContext ()
 ERXArrayChooser (WOContext aContext)
boolean includeUnmatchedValues ()
boolean isBrowser ()
boolean isCheckBox ()
boolean isMandatory ()
boolean isPopup ()
boolean isRadio ()
boolean localizeDisplayKeys ()
String noneString ()
EOQualifier qualifier ()
String relationshipKey ()
void reset ()
void setTheCurrentItem (Object aValue)
boolean sortCaseInsensitive ()
String sourceEntityName ()
Object sourceObject ()
void takeValuesFromRequest (WORequest r, WOContext c)
Object theCurrentItem ()
Object theCurrentValue ()
NSArray theList ()
String uiStyle ()
NSArray unmatchedValues ()

Static Public Attributes

static boolean includeUnmatchedValuesDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.includeUnmatchedValuesDefault", false)
static boolean localizeDisplayKeysDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.localizeDisplayKeysDefault", false)
static final Logger log = Logger.getLogger(ERXArrayChooser.class)
static boolean sortCaseInsensitiveDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.sortCaseInsensitive", false)

Protected Member Functions

EOEntity destinationEntity ()
NSArray destinationSortKeys ()
abstract boolean isSingleSelection ()
void loadBindingsFromSelection ()
String realRelationshipKey ()
Object realSourceObject ()

Protected Attributes

EODataSource _dataSource
String _destinationDisplayKey
String _destinationEntityName
String _destinationSortKey
Boolean _includeUnmatchedValues
Boolean _isMandatory
NSArray _list
Boolean _localizeDisplayKeys
String _noneString
String _relationshipKey
Boolean _sortCaseInsensitive
String _sourceEntityName
Object _sourceObject
String _uiStyle
NSArray _unmatchedValues
Object theCurrentItem

Static Protected Attributes

static final String NO_SELECTION_STRING = "ERXArrayChooser.NoSelectionString"
static final String NO_SORT_STRING = "WONoSorting"


Detailed Description

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)

Constructor & Destructor Documentation

ERXArrayChooser ( WOContext  aContext  ) 


Member Function Documentation

String _destinationEntityName ( boolean  throwExceptionIfMissing  ) 

abstract NSArray currentValues (  )  [pure virtual]

EODataSource dataSource (  ) 

Reimplemented in ERXToManyRelationship.

String destinationDisplayKey (  ) 

EOEntity destinationEntity (  )  [protected]

String destinationEntityName (  ) 

String destinationSortKey (  ) 

NSArray destinationSortKeys (  )  [protected]

EOEditingContext editingContext (  ) 

boolean includeUnmatchedValues (  ) 

boolean isBrowser (  ) 

Reimplemented in ERXToManyRelationship.

boolean isCheckBox (  ) 

boolean isMandatory (  ) 

boolean isPopup (  ) 

boolean isRadio (  ) 

abstract boolean isSingleSelection (  )  [protected, pure virtual]

void loadBindingsFromSelection (  )  [protected]

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".

boolean localizeDisplayKeys (  ) 

String noneString (  ) 

EOQualifier qualifier (  ) 

String realRelationshipKey (  )  [protected]

Object realSourceObject (  )  [protected]

String relationshipKey (  ) 

void reset (  ) 

Reimplemented from ERXStatelessComponent.

Reimplemented in WOToManyRelationship, and WOToOneRelationship.

void setTheCurrentItem ( Object  aValue  ) 

boolean sortCaseInsensitive (  ) 

String sourceEntityName (  ) 

Object sourceObject (  ) 

void takeValuesFromRequest ( WORequest  request,
WOContext  context 
)

Calls resetCachedBindingsInStatefulComponent prior to super.takeValuesFromRequest.

Parameters:
request from which the values will be taken
context of the request

Reimplemented from ERXNonSynchronizingComponent.

Object theCurrentItem (  ) 

Object theCurrentValue (  ) 

NSArray theList (  ) 

Reimplemented in WOToOneRelationship.

String uiStyle (  ) 

NSArray unmatchedValues (  ) 


Member Data Documentation

EODataSource _dataSource [protected]

Boolean _includeUnmatchedValues [protected]

Boolean _isMandatory [protected]

NSArray _list [protected]

Boolean _localizeDisplayKeys [protected]

String _noneString [protected]

String _relationshipKey [protected]

Boolean _sortCaseInsensitive [protected]

Object _sourceObject [protected]

String _uiStyle [protected]

NSArray _unmatchedValues [protected]

boolean includeUnmatchedValuesDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.includeUnmatchedValuesDefault", false) [static]

boolean localizeDisplayKeysDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.localizeDisplayKeysDefault", false) [static]

final Logger log = Logger.getLogger(ERXArrayChooser.class) [static]

logging support

Reimplemented in ERXToManyRelationship.

final String NO_SELECTION_STRING = "ERXArrayChooser.NoSelectionString" [static, protected]

final String NO_SORT_STRING = "WONoSorting" [static, protected]

boolean sortCaseInsensitiveDefault = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXArrayChooser.sortCaseInsensitive", false) [static]

Object theCurrentItem [protected]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:03 2012 for Project Wonder by  doxygen 1.5.8