|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.datadictionary.DictionaryBeanBase org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase org.kuali.rice.krad.uif.component.ComponentBase org.kuali.rice.krad.uif.field.RemoteFieldsHolder
public class RemoteFieldsHolder
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.
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.datadictionary.uif.UifDictionaryBeanBase |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph |
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode |
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.datadictionary.uif.UifDictionaryBean |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph |
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean |
---|
getComponentCode, getNamespaceCode |
Constructor Detail |
---|
public RemoteFieldsHolder()
Method Detail |
---|
public List<InputField> fetchAndTranslateRemoteFields(View view, Object model, Container parent)
ComponentFactory
to translate the fields, and finally sets up the binding for the attribute fields
view
- - view instance the container belongs to, sent to the fetching methodmodel
- - object containing the view data, sent to the fetching methodparent
- - container instance that holder is configured for, sent to the fetching method
public 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 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
public void setFetchingMethodInvoker(MethodInvokerConfig fetchingMethodInvoker)
fetchingMethodInvoker
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |