Project Wonder 5.0

er.extensions.components.javascript
Class ERXJSToManyRelationshipEditor

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.extensions.components.ERXComponent
              extended by er.extensions.components.ERXNonSynchronizingComponent
                  extended by er.extensions.components.javascript.ERXJSToManyRelationshipEditor
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

public class ERXJSToManyRelationshipEditor
extends ERXNonSynchronizingComponent

A fancy to-many relationship editor component.

See Also:
Serialized Form
Author:
Travis Cripps
Bindings
displayString for the items in the menu, this should be a keyPath that will be resolved from each item to produce the display string for the item.
           
item to use as an iteration variable
           
list of items to display; equivalent to the possible values from which a user might choose
           
selections items from the list that are selected. The resulting selections will be pushed back into the parent component's variable that is bound to the selections binding.
           
sortKey (optional) to use in order to produce a sorted menu
           

Nested Class Summary
static interface ERXJSToManyRelationshipEditor.Keys
           
 
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
 
Field Summary
protected  com.webobjects.foundation.NSArray _list
           
protected  com.webobjects.foundation.NSArray _selections
           
protected  java.lang.Object currentItem
           
static org.apache.log4j.Logger log
           
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
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
ERXJSToManyRelationshipEditor(com.webobjects.appserver.WOContext context)
           
 
Method Summary
 java.lang.String addItemScript()
          Builds the JavaScript used to add the selected item from the selections popup to the selected items.
 void appendToResponse(com.webobjects.appserver.WOResponse aResponse, com.webobjects.appserver.WOContext aContext)
          Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.
 java.lang.String availableValuesPopupMenu()
          Builds the select menu for adding available items to the selected items.
 java.lang.Object currentItem()
          Gets the item currently being displayed.
 java.lang.String displayString()
          Gets the display string for the current item.
 java.lang.String editorContextID()
          Gets the context ID of the editor (this component), escaped for use in JavaScript.
 java.lang.String editorName()
          Formats the name of this editor instance.
 java.lang.String hiddenFieldName()
          Formats the name of the hidden field for this editor instance.
 void invalidateCaches()
          Resets the state variables.
 boolean isListEmpty()
          Determines if the list is empty
 boolean isStateless()
          component is not stateless
 int itemIndex()
          Gets the index of the current item in the overall list.
 java.lang.String javascriptForThisEditorInstance()
          Formats the JavaScript used to initialize this instance of the editor.
 com.webobjects.foundation.NSArray list()
          Gets the list of items to display.
 com.webobjects.foundation.NSArray maybeSortedList()
          Gets the list of items and sorts it by the sort key if a sort key is available.
 java.lang.String removeItemScript()
          Builds the JavaScript used to remove the item from the selections.
 void reset()
           
 java.lang.String selectedValuesTableName()
          Formats the name of the selected values table for this editor instance.
 com.webobjects.foundation.NSArray selections()
          Gets the selections.
 java.lang.String selectionsString()
          Formats the selection string for the hidden field from the indexes of the items in the selection subset of the list.
 void setCurrentItem(java.lang.Object anItem)
          Sets the item being displayed.
 void setSelectionsString(java.lang.String value)
          Sets the selection string from the input.
 void sleep()
           
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
invokeAction, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings, takeValuesFromRequest
 
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, 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 org.apache.log4j.Logger log

_list

protected com.webobjects.foundation.NSArray _list

_selections

protected com.webobjects.foundation.NSArray _selections

currentItem

protected java.lang.Object currentItem
Constructor Detail

ERXJSToManyRelationshipEditor

public ERXJSToManyRelationshipEditor(com.webobjects.appserver.WOContext context)
Method Detail

isStateless

public boolean isStateless()
Description copied from class: ERXNonSynchronizingComponent
component is not stateless

Overrides:
isStateless in class ERXNonSynchronizingComponent

reset

public void reset()
Overrides:
reset in class ERXComponent

currentItem

public java.lang.Object currentItem()
Gets the item currently being displayed.

Returns:
the item

setCurrentItem

public void setCurrentItem(java.lang.Object anItem)
Sets the item being displayed.

Parameters:
anItem - to display

list

public com.webobjects.foundation.NSArray list()
Gets the list of items to display.

Returns:
the list of items

selections

public com.webobjects.foundation.NSArray selections()
Gets the selections.

Returns:
the selections

displayString

public java.lang.String displayString()
Gets the display string for the current item.

Returns:
the display string

invalidateCaches

public void invalidateCaches()
Resets the state variables.


sleep

public void sleep()
Overrides:
sleep in class com.webobjects.appserver.WOComponent

appendToResponse

public void appendToResponse(com.webobjects.appserver.WOResponse aResponse,
                             com.webobjects.appserver.WOContext aContext)
Description copied from class: ERXNonSynchronizingComponent
Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.

Overrides:
appendToResponse in class ERXNonSynchronizingComponent
Parameters:
aResponse - to which we are appending
aContext - context of the response

maybeSortedList

public com.webobjects.foundation.NSArray maybeSortedList()
Gets the list of items and sorts it by the sort key if a sort key is available.

Returns:
the maybe sorted list

isListEmpty

public boolean isListEmpty()
Determines if the list is empty

Returns:
true if the list is empty

itemIndex

public int itemIndex()
Gets the index of the current item in the overall list.

Returns:
the index of the current item

selectionsString

public java.lang.String selectionsString()
Formats the selection string for the hidden field from the indexes of the items in the selection subset of the list.

Returns:
the selection string

setSelectionsString

public void setSelectionsString(java.lang.String value)
Sets the selection string from the input. Parses the input string to isolate the indexes of the selected items and looks them up in the array. Then pushes the selections up to the parent binding.

Parameters:
value - of the selections string

editorContextID

public java.lang.String editorContextID()
Gets the context ID of the editor (this component), escaped for use in JavaScript.

Returns:
the context ID

editorName

public java.lang.String editorName()
Formats the name of this editor instance.

Returns:
the editor name

hiddenFieldName

public java.lang.String hiddenFieldName()
Formats the name of the hidden field for this editor instance.

Returns:
the hidden field's name

selectedValuesTableName

public java.lang.String selectedValuesTableName()
Formats the name of the selected values table for this editor instance.

Returns:
the table's name

javascriptForThisEditorInstance

public java.lang.String javascriptForThisEditorInstance()
Formats the JavaScript used to initialize this instance of the editor.

Returns:
the script for this editor

removeItemScript

public java.lang.String removeItemScript()
Builds the JavaScript used to remove the item from the selections.

Returns:
the script

addItemScript

public java.lang.String addItemScript()
Builds the JavaScript used to add the selected item from the selections popup to the selected items.

Returns:
the script

availableValuesPopupMenu

public java.lang.String availableValuesPopupMenu()
Builds the select menu for adding available items to the selected items.

Returns:
the string for the select menu

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.