public class ERXJSPopUpRelationPicker extends ERXStatelessComponent
This WOComponent displays two pop-up buttons. One pop-up displays a list of what can be thought of as parent entities. The second pop-up displays a list of what can be thought of as children entities. When a user selects an entity in the parent list, the child list is instantly modified to reflect the children entities available to the user through that parent. This is done through client-side Javascript. Also handles to-many selections both on the parent and the children.
For example:
parent1(child1,child2,child3)
parent2(child4,child5)
parent3(child2,child5)
When the user selects parent1, its appropriate children are displayed in the second popup.
If the user selects child2 in the children pop-up this is the value that is returned to the
user through the childrenSelection variable. This is either an NSArray if multiple is true
or the single selected object.
For the display of the parent popup, if we aren't passed in a parentSelection, then we default to
parentPopUpStringForAll. If we aren't given that either, then we default to the first parent in the array.
For the display of the child popup, if we aren't passed in a childrenSelection, then we default to childPopUpStringForAll.
If we aren't given that either, then we default to the first child in the array.| Bindings | |
multiple | boolean the defines if there can multiple parents and children selected. |
parentEntitiesList | array of the parent objects that appear in the first pop-up. |
parentToChildrenRelationshipName | name of the relationship from the parent to its possible children. This is used to fill the values that appear in the children popup. |
parentSelection | currently selected parent(s) in the parent pop-up. This can be null, but will return the user-selected parent. |
childrenSelection | returns the user-selected child(ren). |
parentDisplayValueName | keypath of the parent displayed in the parent pop-up |
parentLabel | value displayed in the table interface for the parent popup. |
childLabel | value displayed in the table interface for the child popup. |
defaultChildKey | keypath of the parent for the default child (eg, largest city) |
childrenSortKey | keypath to sort the children on |
childDisplayValueName | keypath of the child displayed in the child pop-up |
parentPopUpStringForAll | to display if no parent is chosen ("- all -") |
childPopUpStringForAll | to display if no child is chosen ("- all -") |
size | number of rows in select boxes |
possibleChildren | shows only these values for children |
WOComponent._EventLoggingEnabler, WOComponent.EventNSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.UtilityNSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessorNSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_childDisplayValueName |
protected java.lang.String |
_childLabel |
protected java.lang.String |
_childPopUpStringForAll |
protected NSArray |
_childrenSelection |
protected java.lang.String |
_childrenSortKey |
protected java.lang.String |
_defaultChildKey |
protected java.lang.Boolean |
_multiple |
protected java.lang.String |
_parentDisplayValueName |
protected NSArray |
_parentEntitiesList |
protected java.lang.String |
_parentLabel |
protected java.lang.String |
_parentPopUpStringForAll |
protected NSArray |
_parentSelection |
protected java.lang.String |
_parentToChildrenRelationshipName |
protected NSArray |
_possibleChildren |
protected java.lang.Integer |
_size |
protected java.lang.String |
childSelectName |
static org.apache.log4j.Logger |
jsLog |
static org.apache.log4j.Logger |
log
logging support
|
protected java.lang.String |
objectsArrayName |
protected java.lang.String |
parentSelectName |
protected java.lang.String |
pickerName |
_dynamicBindings_Extension, _IsEventLoggingEnabled, _keyAssociations_CLASS_CLASS, _KeyPathSeparatorChar, KeyPathSeparatorNullValue_CLASS| Constructor and Description |
|---|
ERXJSPopUpRelationPicker(WOContext aContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
awake() |
java.lang.String |
childDisplayValueName() |
protected java.lang.Object |
childFromID(java.lang.Object parent,
java.lang.String id) |
java.lang.String |
childLabel() |
java.lang.String |
childPopUpString() |
java.lang.String |
childPopUpStringForAll() |
NSArray |
childrenSelection() |
java.lang.String |
childrenSortKey() |
java.lang.String |
defaultChildKey() |
java.lang.String |
formName() |
java.lang.String |
hiddenFormElementStrings() |
protected java.lang.Object |
idForChild(java.lang.Object parent,
java.lang.Object child) |
protected java.lang.Object |
idForParent(java.lang.Object parent) |
java.lang.String |
jsString() |
boolean |
multiple() |
java.lang.String |
objectArrayCreationString() |
protected int |
offsetForChild(java.lang.Object parent,
java.lang.Object child) |
protected int |
offsetForID(java.lang.String id) |
java.lang.String |
parentDisplayValueName() |
NSArray |
parentEntitiesList() |
protected java.lang.Object |
parentFromID(java.lang.String id) |
java.lang.String |
parentLabel() |
java.lang.String |
parentPopUpString() |
java.lang.String |
parentPopUpStringForAll() |
NSArray |
parentSelection() |
java.lang.String |
parentToChildrenRelationshipName() |
protected NSArray |
possibleChildren() |
void |
reset()
このメソッドは、指定されているコンテクストのオブジェクトに対する、
ステートレス・コンポーネントの一時的リファレンスをリセットもしくは削除します。
あるコンポーネントの共有化されたインスタンスが、他のセッションによって再利用されるとき、
このメソッドを利用し、各コンポーネントのインスタンス変数を解放します。
|
protected java.lang.StringBuffer |
selectHeader(java.lang.String nm,
java.lang.String onChange) |
void |
setChildrenSelection(NSArray value) |
void |
setSelectedParents(NSArray value) |
int |
size() |
protected NSArray |
sortedChildren(java.lang.Object parent) |
void |
takeValuesFromRequest(WORequest request,
WOContext context)
Calls
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.takeValuesFromRequest. |
protected NSArray |
unsortedChildren(java.lang.Object parent) |
protected void |
updateVarNames() |
isStateless, valueForBooleanBinding, valueForBooleanBinding, valueForBooleanBinding, valueForIntBinding, valueForObjectBinding, valueForObjectBindingappendToResponse, invokeAction, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, arrayValueForBinding, arrayValueForBinding, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, browser, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, shouldCheckAccess, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript__valueForBinding, _associationWithName, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, 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, setVariableValueForName, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding, variableValueForName, variableWithNamepublic static final org.apache.log4j.Logger log
public static final org.apache.log4j.Logger jsLog
protected java.lang.Integer _size
protected java.lang.String _childDisplayValueName
protected java.lang.String _parentDisplayValueName
protected NSArray _parentEntitiesList
protected java.lang.String _parentToChildrenRelationshipName
protected NSArray _parentSelection
protected NSArray _childrenSelection
protected java.lang.String _parentPopUpStringForAll
protected java.lang.String _childPopUpStringForAll
protected java.lang.String _parentLabel
protected java.lang.String _childLabel
protected java.lang.String _childrenSortKey
protected java.lang.String _defaultChildKey
protected java.lang.Boolean _multiple
protected NSArray _possibleChildren
protected java.lang.String parentSelectName
protected java.lang.String childSelectName
protected java.lang.String pickerName
protected java.lang.String objectsArrayName
public ERXJSPopUpRelationPicker(WOContext aContext)
public void awake()
awake in class WOComponentprotected void updateVarNames()
protected int offsetForID(java.lang.String id)
protected java.lang.Object parentFromID(java.lang.String id)
protected java.lang.Object idForParent(java.lang.Object parent)
protected java.lang.Object childFromID(java.lang.Object parent,
java.lang.String id)
protected int offsetForChild(java.lang.Object parent,
java.lang.Object child)
protected java.lang.Object idForChild(java.lang.Object parent,
java.lang.Object child)
public void takeValuesFromRequest(WORequest request, WOContext context)
ERXNonSynchronizingComponentERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.takeValuesFromRequest.takeValuesFromRequest in class ERXNonSynchronizingComponentrequest - from which the values will be takencontext - of the requestprotected NSArray possibleChildren()
protected NSArray unsortedChildren(java.lang.Object parent)
protected NSArray sortedChildren(java.lang.Object parent)
public java.lang.String jsString()
public java.lang.String hiddenFormElementStrings()
public java.lang.String parentPopUpString()
public java.lang.String formName()
public java.lang.String childPopUpString()
<select name="children_select">
<option value=4>poodle
<option selected value=5>puli
<option value=6>greyhound
</select>protected java.lang.StringBuffer selectHeader(java.lang.String nm,
java.lang.String onChange)
public java.lang.String objectArrayCreationString()
public NSArray parentEntitiesList()
public NSArray parentSelection()
public void setSelectedParents(NSArray value)
public NSArray childrenSelection()
public void setChildrenSelection(NSArray value)
public java.lang.String defaultChildKey()
public java.lang.String childrenSortKey()
public java.lang.String childLabel()
public java.lang.String parentLabel()
public java.lang.String childDisplayValueName()
public java.lang.String parentDisplayValueName()
public java.lang.String parentToChildrenRelationshipName()
public java.lang.String parentPopUpStringForAll()
public java.lang.String childPopUpStringForAll()
public int size()
public boolean multiple()
public void reset()
ERXComponentreset in class ERXStatelessComponentCopyright © 2002 – 2022 Project Wonder.