org.kuali.rice.krad.uif.field
Class RemoteFieldsHolder

java.lang.Object
  extended by org.kuali.rice.krad.uif.component.ConfigurableBase
      extended by org.kuali.rice.krad.uif.component.ComponentBase
          extended by org.kuali.rice.krad.uif.field.RemoteFieldsHolder
All Implemented Interfaces:
Serializable, Component, Configurable, DataBinding, ScriptEventSupport, org.springframework.core.Ordered

public class RemoteFieldsHolder
extends ComponentBase
implements DataBinding

A placeholder in the configuration for a 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.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
RemoteFieldsHolder()
           
 
Method Summary
 List<InputField> fetchAndTranslateRemoteFields(View view, Object model, 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
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addStyleClass, appendToStyle, getAlign, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getEventCode, getFactoryId, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshDiscloseMethodToCall, getRefreshWhenChanged, getRefreshWhenChangedControlNames, getRenderOutput, getRequired, getRowSpan, getStyle, getStyleClasses, getStyleClassesAsString, getSupportsOnBlur, getSupportsOnChange, getSupportsOnClick, getSupportsOnClose, getSupportsOnDblClick, getSupportsOnDocumentReady, getSupportsOnFocus, getSupportsOnKeyDown, getSupportsOnKeyPress, getSupportsOnKeyUp, getSupportsOnLoad, getSupportsOnMouseDown, getSupportsOnMouseMove, getSupportsOnMouseOut, getSupportsOnMouseOver, getSupportsOnMouseUp, getSupportsOnSubmit, getSupportsOnUnload, getTemplate, getTitle, getValign, getWidth, isHidden, isPersistInSession, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, performApplyModel, performFinalize, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAlign, setColSpan, setComponentModifiers, setComponentOptions, setComponentOptionsJSString, setComponentSecurity, setConditionalRefresh, setContext, setFactoryId, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setHidden, setId, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPersistInSession, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefresh, setRefreshDiscloseMethodToCall, setRefreshedByAction, setRefreshWhenChanged, setRender, setRenderOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setStyleClasses, setTemplate, setTitle, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 

Constructor Detail

RemoteFieldsHolder

public RemoteFieldsHolder()
Method Detail

fetchAndTranslateRemoteFields

public List<InputField> fetchAndTranslateRemoteFields(View view,
                                                      Object model,
                                                      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

Parameters:
view - - view instance the container belongs to, sent to the fetching method
model - - object containing the view data, sent to the fetching method
parent - - container instance that holder is configured for, sent to the fetching method
Returns:
List list of attribute fields that should be placed into container, if no remotable fields were returned from the fetching method the list will be empty

getComponentTypeName

public String getComponentTypeName()
Description copied from interface: Component
The name for the component type

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.

Specified by:
getComponentTypeName in interface Component
Returns:
String type name

getPropertyName

public String getPropertyName()
Path to the Map property that the translated fields bind to

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

Specified by:
getPropertyName in interface DataBinding
Returns:
String path to property on model

setPropertyName

public void setPropertyName(String propertyName)
Setter for the property name that points to the binding Map

Parameters:
propertyName -

getBindingInfo

public BindingInfo getBindingInfo()
Can be used to for more complex binding paths

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

Specified by:
getBindingInfo in interface DataBinding
Returns:
BindingInfo instance containing binding information for the Map property
See Also:
BindingInfo

setBindingInfo

public void setBindingInfo(BindingInfo bindingInfo)
Setter for the Map property binding info instance

Specified by:
setBindingInfo in interface DataBinding
Parameters:
bindingInfo -

getFetchingMethodToCall

public String getFetchingMethodToCall()
Name of the method to invoke for retrieving the list of remotable fields

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()

Returns:
String name of method to invoke for fetching remote fields

setFetchingMethodToCall

public void setFetchingMethodToCall(String fetchingMethodToCall)
Setter for the fetching method to call

Parameters:
fetchingMethodToCall -

getFetchingMethodInvoker

public MethodInvokerConfig getFetchingMethodInvoker()
Configuration for the method to invoke for retrieving the list of remotable fields

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

Returns:
MethodInvokerConfig instance containing method configuration

setFetchingMethodInvoker

public void setFetchingMethodInvoker(MethodInvokerConfig fetchingMethodInvoker)
Setter for the fetching method to invoke configuration

Parameters:
fetchingMethodInvoker -


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.