Package net.sf.chainedoptions

Package to handle options and connected values.

See:
          Description

Interface Summary
BeanConverter Interface that provides the operations required for converting beans of some kind into LabelValueBeans.
ChainedOption An ChainedOption is responsible for handling an attribute in a command object, such as a Struts ActionForm or plain Java Bean, and the available options for this attribute.
ChainedOptionManager Responsible for retrieving options and maintaining default values in command objects.
ChainedOptionStrategy Interface for a strategy that is responsible for sorting and filtering the list of available options and providing a reasonable default value.
 

Class Summary
AbstractBeanConverter Abstract class that implements the BeanConverter interface and provides an implementation of AbstractBeanConverter.convert(List)that loops through a list of beans and calls a template method for each bean.
AbstractChainedOption Abstract class that implements the ChainedOption interface and provides an implementation of AbstractChainedOption.updateValue(Object, List, Object).
ChainedOptionManagerImpl Default implementation of ChainedOptionManager.
LabelValueBean Simple name/value pair bean for use in cases where an item has a value and a display label.
 

Package net.sf.chainedoptions Description

Package to handle options and connected values.

Package Specification

In several cases, lists of options and values are interconnected. An example of this is a web page with listboxes that depend on each other. In this case, each listbox has a number of options and a value. The options in each listbox might depend on which value is selected in one or several other listboxes. This interconnection between the listboxes are commonly handled in the action controller or in the presentation layer.

This package separates the handling of available options from the common controller logic by presenting ChainedOption objects managed by an ChainedOptionManager.

Each ChainedOption handled by an ChainedOptionManager typically works on a single command object (such as a Struts ActionForm or plain Java Bean) which contains the currently selected values. The ChainedOptionManager is responsible for calling retrieveOptions and updateValue on each ChainedOption that it handles in the correct sequence (i.e. all dependencies are one-way). Each ChainedOption is responsible for extracting all values it depends on from the command object and retrieving the currently valid options as a List of LabelValueBeans. It is also responsible for optionally updating the selected value in the command object if the currently selected value is not present in the retrieved values.

An abstract class, AbstractChainedOption, is supplied, which contains a default implementation of updateValue and some helper methods.

ChainedOptions may use ChainedOptionStrategy objects for sorting and filtering retrieved values, and BeanConverter objects for converting its target values to LabelValueBeans.

See Also:
ChainedOption, ChainedOptionManager, AbstractChainedOption,

Related Documentation



Copyright ? 2005. All Rights Reserved.