Class MockView

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, Container, LifecycleElement, Helpable, org.springframework.core.Ordered

public class MockView extends FormView
View class for developing UI mocks.

Automatically binds data binding components to a dummy map property on the mock form.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • MockView

      public MockView()
  • Method Details

    • performInitialization

      public void performInitialization(Object model)
      Adjusts the binding paths for data binding components to match the generic data map. The following initialization is performed:
      • If a single paged view, set items in page group and put the page in the items list
      • If ViewSessionPolicy.enableTimeoutWarning is enabled add the session timeout dialogs to the views list of dialog groups
      The following initialization is performed:
      • Sorts the containers list of components
      • Initializes the instructional field if necessary
      • Initializes LayoutManager
      The following updates are done here:
      • Invoke performInitialize on component modifiers
      Initializes the component

      Where components can set defaults and setup other necessary state. The initialize method should only be called once per component lifecycle and is invoked within the initialize phase of the view lifecylce.

      Specified by:
      performInitialization in interface LifecycleElement
      Overrides:
      performInitialization in class View
      Parameters:
      model - - object instance containing the view data
      See Also:
    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      Creates sample data for read only data fields and defaults actions to call the refresh method. The following is performed:
      • Adds to its document ready script the setupValidator js function for setting up the validator for this view
      The following is performed:
      • Adds to its document ready script the setupValidator js function for setting up the validator for this view
      The following finalization is performed:
      • Sets the headerText of the header Group if it is blank
      • Set the messageText of the summary Message if it is blank
      • Finalizes LayoutManager
      The following finalization is done here:
      • progressiveRender and conditionalRefresh variables are processed if set
      • If any of the style properties were given, sets the style string on the style property
      • Set the skipInTabOrder flag for nested components
      The last phase before the view is rendered

      Here final preparations can be made based on the updated view state.

      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class FormView
      Parameters:
      model - - top level object containing the data
      parent - - parent component
    • adjustBindingPath

      protected void adjustBindingPath(DataBinding bindingComponent)
      Adjusts the binding path for the given component to match the generic data map (or boolean data map).
      Parameters:
      bindingComponent - data binding component to adjust path for
    • mockCollectionGroup

      protected void mockCollectionGroup(CollectionGroup collectionGroup, DynaForm dynaForm, String bindingPrefix)
      Adjusts binding paths for the given collection group and sets the collection object class to be DynaDataObject
      Parameters:
      collectionGroup - collection group to adjust
      dynaForm - form instance
      bindingPrefix - prefix for the collection group (in case of a sub-collection)
    • createSampleData

      protected void createSampleData(DataBinding bindingComponent, Object model)
      Creates sample data for the giving binding component.
      Parameters:
      bindingComponent - component to create data for
      model - form instance holding the view's data
    • createSampleLineData

      protected void createSampleLineData(CollectionGroup collectionGroup, Object model)
      Creates sample collection lines for the give collection group.
      Parameters:
      collectionGroup - collection group to create lines for
      model - form instance holding the view's data