Project Wonder 5.0.0.8787

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:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

public class ERXJSToManyRelationshipEditor
extends ERXNonSynchronizingComponent

A fancy to-many relationship editor component.

Author:
Travis Cripps
See Also:
Serialized Form
Bindings
displayStringdisplayString
           
itemitem
           
listlist
           
selectionsselections
           
sortKeysortKey
           

Nested Class Summary
static interface ERXJSToManyRelationshipEditor.Keys
           
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  NSArray _list
           
protected  NSArray _selections
           
protected  Object currentItem
           
static Logger log
           
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
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
ERXJSToManyRelationshipEditor(WOContext context)
           
 
Method Summary
 String addItemScript()
          Builds the JavaScript used to add the selected item from the selections popup to the selected items.
 void appendToResponse(WOResponse aResponse, WOContext aContext)
          Calls _checkAccess prior to super.appendToResponse and adds support for ClickToOpen (TM).
 String availableValuesPopupMenu()
          Builds the select menu for adding available items to the selected items.
 Object currentItem()
          Gets the item currently being displayed.
 String displayString()
          Gets the display string for the current item.
 String editorContextID()
          Gets the context ID of the editor (this component), escaped for use in JavaScript.
 String editorName()
          Formats the name of this editor instance.
 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.
 String javascriptForThisEditorInstance()
          Formats the JavaScript used to initialize this instance of the editor.
 NSArray list()
          Gets the list of items to display.
 NSArray maybeSortedList()
          Gets the list of items and sorts it by the sort key if a sort key is available.
 String removeItemScript()
          Builds the JavaScript used to remove the item from the selections.
 void reset()
           
 String selectedValuesTableName()
          Formats the name of the selected values table for this editor instance.
 NSArray selections()
          Gets the selections.
 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(Object anItem)
          Sets the item being displayed.
 void setSelectionsString(String value)
          Sets the selection string from the input.
 void sleep()
           
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
synchronizesVariablesWithBindings
 
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, invokeAction, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, stringValueForBinding, stringValueForBinding, takeValuesFromRequest, 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, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final Logger log

_list

protected NSArray _list

_selections

protected NSArray _selections

currentItem

protected Object currentItem
Constructor Detail

ERXJSToManyRelationshipEditor

public ERXJSToManyRelationshipEditor(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 Object currentItem()
Gets the item currently being displayed.

Returns:
the item

setCurrentItem

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

Parameters:
anItem - to display

list

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

Returns:
the list of items

selections

public NSArray selections()
Gets the selections.

Returns:
the selections

displayString

public 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 WOComponent

appendToResponse

public void appendToResponse(WOResponse aResponse,
                             WOContext aContext)
Description copied from class: ERXComponent
Calls _checkAccess prior to super.appendToResponse and adds support for ClickToOpen (TM).

Overrides:
appendToResponse in class ERXComponent

maybeSortedList

public 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 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(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 String editorContextID()
Gets the context ID of the editor (this component), escaped for use in JavaScript.

Returns:
the context ID

editorName

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

Returns:
the editor name

hiddenFieldName

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

Returns:
the hidden field's name

selectedValuesTableName

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

Returns:
the table's name

javascriptForThisEditorInstance

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

Returns:
the script for this editor

removeItemScript

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

Returns:
the script

addItemScript

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

Returns:
the script

availableValuesPopupMenu

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

Returns:
the string for the select menu

Last updated: Wed, Jan 7, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.