org.kuali.rice.krad.uif.container
Class ContainerBase

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.container.ContainerBase
All Implemented Interfaces:
Serializable, Component, Configurable, ScriptEventSupport, Container, org.springframework.core.Ordered
Direct Known Subclasses:
Group, View

public abstract class ContainerBase
extends ComponentBase
implements Container

Base Container implementation which container implementations can extend

Provides properties for the basic Container functionality in addition to default implementation of the lifecycle methods including some setup of the header, items list, and layout manager

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
ContainerBase()
          Default Constructor
 
Method Summary
 String getAdditionalMessageKeys()
          Additional keys that should be matching on when gathering errors or other messages for the Container
 List<Component> getComponentPrototypes()
          List of components that are maintained by the component as prototypes for creating other component instances
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the component and should be sent through the lifecycle
 ErrorsField getErrorsField()
          Field that contains the error messages for the container
 Group getFooter()
          Footer Group associated with the container
 HeaderField getHeader()
          HeaderField associated with the container
 Help getHelp()
          Help configuration object for the container
 List<InputField> getInputFields()
          Gets only the data fields that are nested in this container.
 MessageField getInstructionalMessageField()
          Message field that displays instructional text
 String getInstructionalText()
          Text explaining how complete the group inputs, including things like what values should be selected in certain cases, what fields should be completed and so on (instructions)
 int getItemOrderingSequence()
          For Component instances in the container's items list that do not have an order set, a default order number will be assigned using this property.
abstract  List<? extends Component> getItems()
          List of Component instances that are held by the container
 LayoutManager getLayoutManager()
          LayoutManager that should be used to layout the components in the container
 boolean isFieldContainer()
          This property is true if the container is used to display a group of fields that is visually a single field.
 void performApplyModel(View view, Object model, Component parent)
          The following updates are done here:
 void performFinalize(View view, Object model, Component parent)
          The following finalization is performed: Sets the headerText of the header Group if it is blank Set the messageText of the summary MessageField if it is blank Finalizes LayoutManager
 void performInitialization(View view, Object model)
          The following initialization is performed: Sorts the containers list of components Initializes LayoutManager
 void setAdditionalMessageKeys(String additionalMessageKeys)
          Setter for the components additional message key string
 void setErrorsField(ErrorsField errorsField)
          Setter for the containers errors field
 void setFieldContainer(boolean fieldContainer)
           
 void setFooter(Group footer)
          Setter for the containers footer
 void setHeader(HeaderField header)
          Setter for the containers header field
 void setHelp(Help help)
          Setter for the containers help content
 void setInstructionalMessageField(MessageField instructionalMessageField)
          Setter for the instructional text message field
 void setInstructionalText(String instructionalText)
          Setter for the instructional message
 void setItemOrderingSequence(int itemOrderingSequence)
          Setter for the container's item ordering sequence number (initial value)
abstract  void setItems(List<? extends Component> items)
          Setter for the containers list of components
 void setLayoutManager(LayoutManager layoutManager)
          Setter for the containers layout manager
 void setRenderFooter(boolean renderFooter)
          Convenience setter for configuration to turn rendering of the footer on/off
 void setRenderHeader(boolean renderHeader)
          Convenience setter for configuration to turn rendering of the header on/off
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addStyleClass, appendToStyle, getAlign, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, 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, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAlign, setColSpan, setComponentModifiers, setComponentOptions, setComponentOptionsJSString, 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, 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.container.Container
getSupportedComponents
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addStyleClass, appendToStyle, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, getComponentTypeName, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getFactoryId, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshWhenChanged, getRefreshWhenChangedControlNames, getRenderOutput, getRequired, getRowSpan, getStyle, getStyleClasses, getTemplate, getTitle, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, pushAllToContext, pushObjectToContext, setColSpan, setComponentModifiers, setComponentOptions, setComponentOptionsJSString, setConditionalRefresh, setContext, setFactoryId, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefresh, setRefreshedByAction, setRefreshWhenChanged, setRender, setRenderOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setStyleClasses, setTemplate, setTitle
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getSupportsOnBlur, getSupportsOnChange, getSupportsOnClick, getSupportsOnClose, getSupportsOnDblClick, getSupportsOnDocumentReady, getSupportsOnFocus, getSupportsOnKeyDown, getSupportsOnKeyPress, getSupportsOnKeyUp, getSupportsOnLoad, getSupportsOnMouseDown, getSupportsOnMouseMove, getSupportsOnMouseOut, getSupportsOnMouseOver, getSupportsOnMouseUp, getSupportsOnSubmit, getSupportsOnUnload, setOnBlurScript, setOnDocumentReadyScript, setOnLoadScript
 

Constructor Detail

ContainerBase

public ContainerBase()
Default Constructor

Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model)
The following initialization is performed:

Specified by:
performInitialization in interface Component
Overrides:
performInitialization in class ComponentBase
Parameters:
view - - view instance in which the component belongs
model - - object instance containing the view data
See Also:
ComponentBase.performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)

performApplyModel

public void performApplyModel(View view,
                              Object model,
                              Component parent)
Description copied from class: ComponentBase
The following updates are done here:

Specified by:
performApplyModel in interface Component
Overrides:
performApplyModel in class ComponentBase
Parameters:
view - - view instance to which the component belongs
model - - Top level object containing the data (could be the form or a top level business object, dto)
See Also:
ComponentBase.performApplyModel(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
The following finalization is performed:

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
parent - - parent component
See Also:
ComponentBase.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: Component
List of components that are contained within the component and should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Specified by:
getComponentsForLifecycle in interface Component
Overrides:
getComponentsForLifecycle in class ComponentBase
Returns:
List child components
See Also:
ComponentBase.getComponentsForLifecycle()

getComponentPrototypes

public List<Component> getComponentPrototypes()
Description copied from interface: Component
List of components that are maintained by the component as prototypes for creating other component instances

Prototypes are held for configuring how a component should be created during the lifecycle. An example of this are the fields in a collection group that are created for each collection record. They only participate in the initialize phase.

Specified by:
getComponentPrototypes in interface Component
Overrides:
getComponentPrototypes in class ComponentBase
Returns:
List child component prototypes
See Also:
Component.getComponentPrototypes()

getAdditionalMessageKeys

public String getAdditionalMessageKeys()
Additional keys that should be matching on when gathering errors or other messages for the Container

Messages associated with the container will be displayed with the container grouping in the user interface. Typically, these are a result of problems with the containers fields or some other business logic associated with the containers information. The framework will by default include all the error keys for fields in the container, and also an errors associated with the containers id. Keys given here will be matched in addition to those defaults.

Multple keys can be given using the comma delimiter, the * wildcard is also allowed in the message key

Returns:
String additional message key string

setAdditionalMessageKeys

public void setAdditionalMessageKeys(String additionalMessageKeys)
Setter for the components additional message key string

Parameters:
additionalMessageKeys -

getErrorsField

public ErrorsField getErrorsField()
Description copied from interface: Container
Field that contains the error messages for the container

Containers can collect the errors for the contained component and display either all the messages or counts. This Field is used to render those messages. Styling and other configuration is done through the ErrorsField

Specified by:
getErrorsField in interface Container
Returns:
ErrorsField holding the container errors
See Also:
Container.getErrorsField()

setErrorsField

public void setErrorsField(ErrorsField errorsField)
Description copied from interface: Container
Setter for the containers errors field

Specified by:
setErrorsField in interface Container
See Also:
Container.setErrorsField(org.kuali.rice.krad.uif.field.ErrorsField)

getHelp

public Help getHelp()
Description copied from interface: Container
Help configuration object for the container

External help information can be configured for the container. The Help object can the configuration for rendering a link to that help information.

Specified by:
getHelp in interface Container
Returns:
Help for container
See Also:
Container.getHelp()

setHelp

public void setHelp(Help help)
Description copied from interface: Container
Setter for the containers help content

Specified by:
setHelp in interface Container
See Also:
Container.setHelp(org.kuali.rice.krad.uif.widget.Help)

getItems

public abstract List<? extends Component> getItems()
Description copied from interface: Container
List of Component instances that are held by the container

Contained components are rendered within the section template by calling the associated LayoutManager

Specified by:
getItems in interface Container
Returns:
List component instances
See Also:
Container.getItems()

setItems

public abstract void setItems(List<? extends Component> items)
Setter for the containers list of components

Specified by:
setItems in interface Container
Parameters:
items -

getItemOrderingSequence

public int getItemOrderingSequence()
For Component instances in the container's items list that do not have an order set, a default order number will be assigned using this property. The first component found in the list without an order will be assigned the configured initial value, and incremented by one for each component (without an order) found afterwards

Returns:
int order sequence

setItemOrderingSequence

public void setItemOrderingSequence(int itemOrderingSequence)
Setter for the container's item ordering sequence number (initial value)

Parameters:
itemOrderingSequence -

getLayoutManager

public LayoutManager getLayoutManager()
Description copied from interface: Container
LayoutManager that should be used to layout the components in the container

The template associated with the layout manager will be invoked passing in the List of components from the container. This list is exported under the attribute name 'items'

Specified by:
getLayoutManager in interface Container
Returns:
LayoutManager instance
See Also:
Container.getLayoutManager()

setLayoutManager

public void setLayoutManager(LayoutManager layoutManager)
Description copied from interface: Container
Setter for the containers layout manager

Specified by:
setLayoutManager in interface Container
See Also:
Container.setLayoutManager(org.kuali.rice.krad.uif.layout.LayoutManager)

getHeader

public HeaderField getHeader()
Description copied from interface: Container
HeaderField associated with the container

Header fields are generally rendered at the beginning of the container to indicate a grouping, although this is determined by the template associated with the container. The actual rendering configuration (style and so on) is configured within the HeaderField instance

Header is only rendered if Container#isRenderHeader is true and getHeader() is not null

Specified by:
getHeader in interface Container
Returns:
HeaderField instance or Null
See Also:
Container.getHeader()

setHeader

public void setHeader(HeaderField header)
Description copied from interface: Container
Setter for the containers header field

Specified by:
setHeader in interface Container
See Also:
Container.setHeader(org.kuali.rice.krad.uif.field.HeaderField)

getFooter

public Group getFooter()
Description copied from interface: Container
Footer Group associated with the container

The footer is usually rendered at the end of the container. Often this is a place to put actions (buttons) for the container.

Footer is only rendered if Container#isRenderFooter is true and getFooter is not null

Specified by:
getFooter in interface Container
Returns:
Group footer instance or Null
See Also:
Container.getFooter()

setFooter

public void setFooter(Group footer)
Description copied from interface: Container
Setter for the containers footer

Specified by:
setFooter in interface Container
See Also:
Container.setFooter(org.kuali.rice.krad.uif.container.Group)

setRenderHeader

public void setRenderHeader(boolean renderHeader)
Convenience setter for configuration to turn rendering of the header on/off

For nested groups (like Field Groups) it is often necessary to only show the container body (the contained components). This method allows the header to not be displayed

Parameters:
renderHeader -

setRenderFooter

public void setRenderFooter(boolean renderFooter)
Convenience setter for configuration to turn rendering of the footer on/off

For nested groups it is often necessary to only show the container body (the contained components). This method allows the footer to not be displayed

Parameters:
renderFooter -

getInstructionalText

public String getInstructionalText()
Text explaining how complete the group inputs, including things like what values should be selected in certain cases, what fields should be completed and so on (instructions)

Returns:
String instructional message

setInstructionalText

public void setInstructionalText(String instructionalText)
Setter for the instructional message

Parameters:
instructionalText -

getInstructionalMessageField

public MessageField getInstructionalMessageField()
Message field that displays instructional text

This message field can be configured to for adjusting how the instructional text will display. Generally the styleClasses property will be of most interest

Specified by:
getInstructionalMessageField in interface Container
Returns:
MessageField instructional message field

setInstructionalMessageField

public void setInstructionalMessageField(MessageField instructionalMessageField)
Setter for the instructional text message field

Note this is the setter for the field that will render the instructional text. The actual text can be set on the field but can also be set using setInstructionalText(String)

Specified by:
setInstructionalMessageField in interface Container
Parameters:
instructionalMessageField -

getInputFields

public List<InputField> getInputFields()
Gets only the data fields that are nested in this container. This is a subset of what getComponentsForLifecycle() returns

Returns:

isFieldContainer

public boolean isFieldContainer()
This property is true if the container is used to display a group of fields that is visually a single field.

Specified by:
isFieldContainer in interface Container
Returns:
the fieldContainer

setFieldContainer

public void setFieldContainer(boolean fieldContainer)
Specified by:
setFieldContainer in interface Container
Parameters:
fieldContainer - the fieldContainer to set


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