public class RemoteFieldsHolder extends ComponentBase implements DataBinding
Container
list of items that will be invoked to
retrieve a list of RemotableAttributeField
instances which will then be inserted into the containers
list at the position of the holder
Since remotable fields are dynamic by nature, the individual fields cannot be configured initially with the container. Further more the properties for the field are constructed with code. This gives the ability to specify where that list of fields should be placed, along with configured on how to retrieve the remote fields.
The fetching properties are used to configure what method to invoke that will return the list of remotable fields.
Specifying the getFetchingMethodToCall()
only assumes the method is on the view helper service for the
contained view. For invoking other classes, such as services or static classes, use getFetchingMethodInvoker()
The list of remotable fields should bind to a Map property on the model. The getPropertyName()
and
getBindingInfo()
properties specify the path to this property. The property names configured on the
returned fields are assumed to be keys in that above configured map, with the corresponding map value giving the
actual model value for the remote field.
e.g. configuration
<property name="items">
<list>
<bean parent="RemoteFieldsHolder" p:propertyName="remoteFieldValuesMap"
p:fetchingMethodToCall="retrieveRemoteFields"/>
...
This example will invoke a method named 'retrieveRemoteFields' on the view helper service, which should return
a list of RemotableAttributeField
instances. The view, model instance, and parent container will be sent
to the method as arguments.
The returned fields will be translated to InputField
instances that bind to a map property named
'remoteFieldValuesMap' on the model.
templateOptions
componentCode, namespaceCode
INITIAL_ORDER_VALUE
Constructor and Description |
---|
RemoteFieldsHolder() |
Modifier and Type | Method and Description |
---|---|
List<InputField> |
fetchAndTranslateRemoteFields(Container parent)
Invokes the configured fetching method to retrieve a list of remotable fields, then invoked the
ComponentFactory to translate the fields, and finally sets up the binding for the attribute fields |
BindingInfo |
getBindingInfo()
Can be used to for more complex binding paths
|
String |
getComponentTypeName()
The name for the component type
|
MethodInvokerConfig |
getFetchingMethodInvoker()
Configuration for the method to invoke for retrieving the list of remotable fields
|
String |
getFetchingMethodToCall()
Name of the method to invoke for retrieving the list of remotable fields
|
String |
getPropertyName()
Path to the Map property that the translated fields bind to
|
void |
setBindingInfo(BindingInfo bindingInfo)
Setter for the Map property binding info instance
|
void |
setFetchingMethodInvoker(MethodInvokerConfig fetchingMethodInvoker)
Setter for the fetching method to invoke configuration
|
void |
setFetchingMethodToCall(String fetchingMethodToCall)
Setter for the fetching method to call
|
void |
setPropertyName(String propertyName)
Setter for the property name that points to the binding Map
|
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, afterEvaluateExpression, appendToStyle, checkMutable, clone, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContainerIdSuffix, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performApplyModel, performFinalize, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContainerIdSuffix, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setExcludeIf, setExcludeUnless, setFieldsToSendOnRefresh, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOmitFromFormPost, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycle
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, afterEvaluateExpression, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFieldsToSendOnRefresh, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOmitFromFormPost, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performApplyModel, performFinalize, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycle
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
public RemoteFieldsHolder()
public List<InputField> fetchAndTranslateRemoteFields(Container parent)
ComponentFactory
to translate the fields, and finally sets up the binding for the attribute fieldsparent
- container instance that holder is configured for, sent to the fetching methodpublic String getComponentTypeName()
Component
This is used within the rendering layer to pass the component instance into the template. The component instance is exported under the name given by this method.
getComponentTypeName
in interface Component
public String getPropertyName()
It is assumed this property points to a Map where the property names on the returned remotable fields are keys in that map, with the corresponding map value giving the model value for the field
getPropertyName
in interface DataBinding
public void setPropertyName(String propertyName)
propertyName
- public BindingInfo getBindingInfo()
Generally not necessary to set on a field level, any default object path or binding prefixes set on the view or container will be inherited
getBindingInfo
in interface DataBinding
BindingInfo
public void setBindingInfo(BindingInfo bindingInfo)
setBindingInfo
in interface DataBinding
bindingInfo
- public String getFetchingMethodToCall()
When only the fetching method to call is configured it is assumed to be a valid method on the view
helper service for the containing view. The method name must accept the view, model object, and parent
container as arguments, and return a list of RemotableAttributeField
instances.
For invoking the method on classes other than the view helper service, see getFetchingMethodInvoker()
public void setFetchingMethodToCall(String fetchingMethodToCall)
fetchingMethodToCall
- public MethodInvokerConfig getFetchingMethodInvoker()
Through the method invoker config, a service or static class can be configured along with the
method name that will be invoked. The method name must accept the view, model object, and parent
container as arguments, and return a list of RemotableAttributeField
instances.
Note the MethodInvokerConfig.getTargetMethod()
property can
be configured, or the getFetchingMethodToCall()
. In the case of both configurations, the target
method on the method invoker config will be used
public void setFetchingMethodInvoker(MethodInvokerConfig fetchingMethodInvoker)
fetchingMethodInvoker
- Copyright © 2005–2015 The Kuali Foundation. All rights reserved.