|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.chainedoptions.support.OptionalRefreshChainedOption
public class OptionalRefreshChainedOption
Decorator to provide support for optional refresh on the target
ChainedOption. The specified refreshProperty
property on the target command is inspected prior to
forwarding any retrieveOptions and updateValue
calls to the target ChainedOption.
If this property is false an empty List will be returned by
retrieveOptions, and updateValue will do
nothing.
Such a behavior is useful for example when a click in a checkbox should change another field between a selectbox (for fixed values) and a textbox (for free text search).
| Constructor Summary | |
|---|---|
OptionalRefreshChainedOption()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
java.lang.String |
getOptionsKey()
Forward the call to the target ChainedOption |
ChainedOptionStrategy |
getStrategy(java.lang.Object command)
Forward the call to the target ChainedOption. |
java.util.List |
retrieveOptions(java.lang.Object command,
java.lang.Object context)
Forward the retrieveOptions call to the target
ChainedOption if the refreshProperty property
on the target command is true. |
void |
setChainedOption(ChainedOption chainedOption)
Set the ChainedOption that this decorator wraps. |
void |
setRefreshProperty(java.lang.String refreshProperty)
Set the name of the property to inspect on the command
object to determine whether retrieveOptions(Object, Object)and
updateValue(Object, List, Object)should forward the call to the
target ChainedOption. |
void |
updateValue(java.lang.Object command,
java.util.List options,
java.lang.Object context)
Forward the updateValue call to the target
ChainedOptionrefreshProperty property on the target command is true. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OptionalRefreshChainedOption()
| Method Detail |
|---|
public java.util.List retrieveOptions(java.lang.Object command,
java.lang.Object context)
retrieveOptions call to the target
ChainedOption if the refreshProperty property
on the target command is true.
retrieveOptions in interface ChainedOptioncommand - Command object to use when extracting values that the
ChainedOption depends on.context - may contain any context that might be interesting for
retreiving valid options. E.g. a
HttpServletRequest object can be supplied as
context for a Strategy to perform filtering based on user
access.
LinkedList otherwise.ChainedOption.retrieveOptions(java.lang.Object, java.lang.Object)
public void updateValue(java.lang.Object command,
java.util.List options,
java.lang.Object context)
updateValue call to the target
ChainedOptionrefreshProperty property on the target command is true.
updateValue in interface ChainedOptioncommand - The command object that may be updated.options - A list of LabelValueBeanobjects to choose from.context - may contain any context that might be interesting for
retreiving valid options. E.g. a
HttpServletRequest object can be supplied as
context for a Strategy to perform filtering based on user
access.ChainedOption.updateValue(java.lang.Object, java.util.List, java.lang.Object)public java.lang.String getOptionsKey()
ChainedOption
getOptionsKey in interface ChainedOptionpublic void setChainedOption(ChainedOption chainedOption)
ChainedOption that this decorator wraps.
chainedOption - the ChainedOption to forward calls to.public void setRefreshProperty(java.lang.String refreshProperty)
command
object to determine whether retrieveOptions(Object, Object)and
updateValue(Object, List, Object)should forward the call to the
target ChainedOption.
refreshProperty - name of the property.
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic ChainedOptionStrategy getStrategy(java.lang.Object command)
ChainedOption.
getStrategy in interface ChainedOptioncommand - the command to operate on.
ChainedOption.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||