|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ViewHelperService
Provides methods for implementing the various phases of a View
Method Summary | |
---|---|
void |
applyDefaultValuesForCollectionLine(View view,
Object model,
CollectionGroup collectionGroup,
Object line)
Applies configured default values for the line fields to the line instance |
String |
buildExportTableData(View view,
Object model,
String tableId,
String formatType)
Generates table formatted data based on data collected from the table model |
void |
buildInquiryLink(Object dataObject,
String propertyName,
Inquiry inquiry)
Invoked by the Inquiry widget to build the inquiry link |
void |
cleanViewAfterRender(View view)
Invoked after the view has been rendered to clear out objects that are not necessary to keep around for the post, this helps reduce the view size and overall cost to store the form in session |
Map<String,Object> |
getCommonContext(View view,
Component component)
Gets global objects for the context map and pushes them to the context for the component |
ExpressionEvaluator |
getExpressionEvaluator()
Return an instance of ExpressionEvaluator that can be used for evaluating
expressions
contained on the view |
void |
performApplyModel(View view,
Object model)
Executes the ApplyModel phase. |
void |
performComponentInitialization(View view,
Object model,
Component component)
Performs the Initialization phase for the given Component |
void |
performComponentLifecycle(View view,
Object model,
Component component,
String origId)
Performs the complete component lifecycle on the component passed in for use during a refresh process |
void |
performFinalize(View view,
Object model)
The last phase before the view is rendered. |
void |
performInitialization(View view,
Object model)
Performs the Initialization phase for the View . |
void |
populateViewFromRequestParameters(View view,
Map<String,String> parameters)
Populates the View properties from the given request
parameters |
void |
processCollectionAddBlankLine(View view,
Object model,
String collectionPath)
Adds a blank line to the collection |
void |
processCollectionAddLine(View view,
Object model,
String collectionPath)
Invoked when the add line action is chosen for a collection. |
void |
processCollectionDeleteLine(View view,
Object model,
String collectionPath,
int lineIndex)
Invoked when the delete line action is chosen for a collection. |
void |
processCollectionSaveLine(View view,
Object model,
String collectionPath,
int selectedLineIndex)
Invoked when the save line action is chosen for a collection. |
void |
processMultipleValueLookupResults(View view,
Object model,
String collectionPath,
String lookupResultValues)
Process the results returned from a multi-value lookup populating the lines for the collection given by the path |
void |
refreshReferences(Object model,
String referencesToRefresh)
Update the reference objects listed in referencesToRefresh of the model |
void |
spawnSubLifecyle(View view,
Object model,
Component component,
Component parent,
String startPhase,
String endPhase)
Runs the lifecycle process for the given component starting at the given start phase and ending with the given end phase |
Method Detail |
---|
void populateViewFromRequestParameters(View view, Map<String,String> parameters)
View
properties from the given request
parameters
The View
instance is inspected for fields that have the
RequestParameter
annotation and if corresponding parameters
are found in the request parameter map, the request value is used to set
the view property. The Map of parameter name/values that match are placed
in the view so they can be later retrieved to rebuild the view. Custom
ViewServiceHelper
implementations can add additional
parameter key/value pairs to the returned map if necessary.
RequestParameter
void performInitialization(View view, Object model)
View
. During this
phase each component of the tree is invoked to setup state based on the
configuration and request options.
The initialize phase is only called once per View
lifecycle
Note the View
instance also contains the context Map that
was created based on the parameters sent to the view service
view
- View instance that should be initializedmodel
- object instance containing the view datavoid performComponentInitialization(View view, Object model, Component component)
Component
Can be called for component instances constructed via code or prototypes to initialize the constructed component
view
- view instance the component belongs tomodel
- object instance containing the view datacomponent
- component instance that should be initializedvoid performApplyModel(View view, Object model)
Part of the view lifecycle that applies the model data to the view. Should be called after the model has been populated before the view is rendered. The main things that occur during this phase are:
The update phase can be called multiple times for the view's lifecycle (typically only once per request)
view
- View instance that the model should be applied tomodel
- Top level object containing the data (could be the form or a
top level business object, dto)Map<String,Object> getCommonContext(View view, Component component)
view
- view instance for componentcomponent
- component instance to push context tovoid performFinalize(View view, Object model)
The finalize phase runs after the apply model phase and can be called multiple times for the view's lifecylce (however typically only once per request)
view
- view instance that should be finalized for renderingmodel
- top level object containing the datavoid cleanViewAfterRender(View view)
view
- view instance to be cleanedvoid performComponentLifecycle(View view, Object model, Component component, String origId)
Runs the three lifecycle phases on the component passed in. Some adjustments are made to account for the component being processed without its parent. The component within the view (contained on the form) is retrieved to obtain the context to use (such as parent). The created components id is then updated to match the current id within the view.
view
- view instance the component belongs tomodel
- object containing the full view datacomponent
- component instance to perform lifecycle fororigId
- id of the component within the view, used to pull the current component from the viewvoid spawnSubLifecyle(View view, Object model, Component component, Component parent, String startPhase, String endPhase)
Start or end phase can be null to indicate the first phase or last phase respectively
view
- view instance the component belongs tomodel
- object providing the view datacomponent
- component to run the lifecycle phases forparent
- parent component for the component being processedstartPhase
- lifecycle phase to start with, or null to indicate the first phaseendPhase
- lifecycle phase to end with, or null to indicate the last phasevoid refreshReferences(Object model, String referencesToRefresh)
The the individual references in the referencesToRefresh string are separated by KRADConstants.REFERENCES_TO_REFRESH_SEPARATOR).
model
- top level object containing the datareferencesToRefresh
- list of references to refresh (void processCollectionAddLine(View view, Object model, String collectionPath)
MessageMap
view
- view instance that is being presented (the action was taken on)model
- Top level object containing the view data including the
collection and new linecollectionPath
- full path to the collection on the modelvoid processCollectionAddBlankLine(View view, Object model, String collectionPath)
Adds a new collection item to the collection and applies any default values.
view
- view instance that is being presented (the action was taken on)model
- Top level object containing the view data including the collection and new linecollectionPath
- full path to the collection on the modelvoid processCollectionSaveLine(View view, Object model, String collectionPath, int selectedLineIndex)
view
- view instance that is being presented (the action was taken on)model
- Top level object containing the view data including the collection and new linecollectionPath
- full path to the collection on the modelvoid processCollectionDeleteLine(View view, Object model, String collectionPath, int lineIndex)
MessageMap
view
- view instance that is being presented (the action was taken on)model
- Top level object containing the view data including the collectioncollectionPath
- full path to the collection on the modellineIndex
- index of the collection line that was selected for removalvoid processMultipleValueLookupResults(View view, Object model, String collectionPath, String lookupResultValues)
view
- view instance the collection belongs tomodel
- object containing the view datacollectionPath
- binding path to the collection to populatedlookupResultValues
- String containing the selected line valuesvoid buildInquiryLink(Object dataObject, String propertyName, Inquiry inquiry)
Inquiry
widget to build the inquiry link
Note this is used primarily for custom Inquirable
implementations to customize the inquiry class or parameters for an
inquiry. Instead of building the full inquiry link, implementations can
make a callback to
org.kuali.rice.krad.uif.widget.Inquiry.buildInquiryLink(Object, String,
Class>, Map
dataObject
- parent object for the inquiry propertypropertyName
- name of the property the inquiry is being built forinquiry
- instance of the inquiry widget being built for the propertyvoid applyDefaultValuesForCollectionLine(View view, Object model, CollectionGroup collectionGroup, Object line)
view
- view instance the collection line belongs tomodel
- object containing the full view datacollectionGroup
- collection group component the line belongs toline
- line instance to apply default values toExpressionEvaluator getExpressionEvaluator()
ExpressionEvaluator
that can be used for evaluating
expressions
contained on the view
A ExpressionEvaluator must be initialized with a model for expression evaluation. One instance is constructed for the view lifecycle and made available to all components/helpers through this method
String buildExportTableData(View view, Object model, String tableId, String formatType)
view
- view instance where the table is locatedmodel
- top level object containing the datatableId
- id of the table being generatedformatType
- format which the table should be generated in
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |