Interface LifecycleElement
- All Superinterfaces:
Cloneable,Copyable,Serializable
- All Known Subinterfaces:
CollectionGroup,CollectionLayoutManager,Component,Container,ContentElement,Control,DataBinding,DataField,Field,GridLayoutManager,Group,InputField,LayoutManager,PageGroup,SelectControl,StackedLayoutManager,TableLayoutManager,TextControl,Widget
- All Known Implementing Classes:
Accordion,AccordionGroup,Action,ActionField,ApplicationHeader,BlockUI,BoxLayoutManager,BreadcrumbItem,Breadcrumbs,CheckboxControl,CheckboxGroupControl,CollectionGroupBase,CollectionLayoutManagerBase,ComponentBase,ContainerBase,Content,ContentElementBase,ControlBase,CssGridLabelColumnLayoutManager,CssGridLayoutManager,CssGridLayoutManagerBase,DataFieldBase,DataTable,DatePicker,DialogGroup,Disclosure,Div,DocumentView,FieldBase,FieldGroup,FileControl,FormView,GenericField,GridLayoutManagerBase,GroupBase,GroupControl,GroupLinkField,Growls,Header,HeadLink,Help,HiddenControl,Icon,Iframe,IframeView,Image,ImageField,InputFieldBase,Inquiry,InquiryView,Label,LayoutManagerBase,LightBox,LightTable,Link,LinkField,LinkGroup,ListLayoutManager,LocationSuggest,LookupInputField,LookupView,MaintenanceDocumentView,Message,MessageField,MessageView,MetaTag,MockView,MultiFileUploadCollection,MultiValueControlBase,NavigationBar,NextPager,NumberedPager,OptionListControl,PageGroupBase,Pager,PasswordControl,ProgressBar,ProgressBarField,QuickFinder,RadioGroupControl,RemoteFieldsHolder,RichTable,RoleLinkField,Scrollpane,SelectControlBase,SidebarNavigationGroup,SimpleLayoutManager,Space,SpaceField,Spinner,SpinnerControl,StackedLayoutManagerBase,StepProgressBar,Suggest,SyntaxHighlighter,TabGroup,TableLayoutManagerBase,TabNavigationGroup,Tabs,TextAreaControl,TextControlBase,ToggleMenu,Tooltip,TransactionalDocumentView,Tree,TreeGroup,UserControl,UserLinkField,View,ViewHeader,WidgetBase
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMutable(boolean legalDuringInitialization) Check for mutability on the element before modifying state.A string suffix that should get applied to the id for all child components of the given element.Context map for the lifecycle element.getId()The unique id (within a given tree) for the element.Map of paths for this component that will be used to process a refresh (if necessary).Gets a property for referring to this component from the view, relative to the view, as assigned by the current or most recent lifecycle.Get the view lifecycle processing status for this component.booleanisFinal()Indicates whether the component has been updated from the model and final updates made.booleanIndicates whether the component has been initialized.booleanIndicates whether the component has been updated from the model.booleanisMutable(boolean legalBeforeConfiguration) Determine if this lifecycle element is mutable.booleanisRender()Indicates whether the component should be rendered in the UIvoidReceive notification that a lifecycle phase, and all successor phases, have been completed on this component.voidperformApplyModel(Object model, LifecycleElement parent) Deprecated.voidperformFinalize(Object model, LifecycleElement parent) Deprecated.Special processing within this method should be replaced byViewLifecycleTaskand initialized by.invalid reference
#initializePendingTasks(ViewLifecyclePhase, Queue)voidperformInitialization(Object model) Deprecated.Special processing within this method should be replaced byViewLifecycleTaskand initialized by.invalid reference
#initializePendingTasks(ViewLifecyclePhase, Queue)voidpushAllToContext(Map<String, Object> objects) Places each entry of the given Map into the context for the componentvoidpushObjectToContext(String objectName, Object object) Places the given object into the context Map for the component with the given namevoidsetContainerIdSuffix(String containerIdSuffix) voidsetContext(Map<String, Object> context) voidSetter for the unique id (within a given tree) for the componentvoidsetPhasePathMapping(Map<String, String> phasePathMapping) voidsetRender(boolean render) Setter for the components render indicatorvoidsetViewPath(String viewPath) Setter forgetViewPath().voidsetViewStatus(String viewStatus) Sets the view status.booleanReturn true if the lifecycle should be skipped for this component.
-
Method Details
-
getId
String getId()The unique id (within a given tree) for the element.The id is used to identify an element instance within the tree, and will be used by renderers to set the HTML element id. This gives a way to find various elements for scripting. If the id is not given, a default will be generated by the framework.
- Returns:
- A unique ID for this lifecycle element.
-
setId
Setter for the unique id (within a given tree) for the component- Parameters:
id- - string to set as the component id
-
getContainerIdSuffix
String getContainerIdSuffix()A string suffix that should get applied to the id for all child components of the given element.This is mainly used within the framework to keep ids unique. For instance, for components generated for collection lines, all the components within those should get a line suffix. The framework will set this property to be '_line0', '_line1', etc. Then when the apply model phase is run on the child components their ids will be updated with this suffix.
- Returns:
- String id suffix for child components
- See Also:
-
setContainerIdSuffix
- See Also:
-
getViewPath
String getViewPath()Gets a property for referring to this component from the view, relative to the view, as assigned by the current or most recent lifecycle.- Returns:
- property path
-
setViewPath
Setter forgetViewPath().- Parameters:
viewPath- The property path.
-
getPhasePathMapping
Map of paths for this component that will be used to process a refresh (if necessary).- Returns:
- map of refresh paths, key represents the lifecycle phase and the value is the path for the component at that phase
-
setPhasePathMapping
- See Also:
-
isMutable
boolean isMutable(boolean legalBeforeConfiguration) Determine if this lifecycle element is mutable.Most lifecycle element are immutable, and all are immutable expect during initialization and the during the view lifecycle. Those that have been copied within the view lifecycle, however, may be modified during the same lifecycle.
- Parameters:
legalBeforeConfiguration- true if the current operation may be called before the lifecycle element has been cached, for example while being initialized as part of a Spring context.- Returns:
- True if the component is mutable.
-
checkMutable
void checkMutable(boolean legalDuringInitialization) Check for mutability on the element before modifying state.- Parameters:
legalDuringInitialization- True if the operation is legal during view initialization, false if the operation is only allowed during the component lifecycle.- Throws:
IllegalStateException- If the component is not mutable and the lifecycle is operating in strict mode.- See Also:
-
getViewStatus
String getViewStatus()Get the view lifecycle processing status for this component.- Returns:
- The view lifecycle processing status for this component.
- See Also:
-
setViewStatus
Sets the view status.- Parameters:
viewStatus- view status- See Also:
-
isRender
boolean isRender()Indicates whether the component should be rendered in the UIIf set to false, the corresponding component template will not be invoked (therefore nothing will be rendered to the UI).
- Returns:
- boolean true if the component should be rendered, false if it should not be
-
setRender
void setRender(boolean render) Setter for the components render indicator- Parameters:
render-
-
isInitialized
boolean isInitialized()Indicates whether the component has been initialized.- Returns:
- True if the component has been initialized, false if not.
-
isModelApplied
boolean isModelApplied()Indicates whether the component has been updated from the model.- Returns:
- True if the component has been updated, false if not.
-
isFinal
boolean isFinal()Indicates whether the component has been updated from the model and final updates made.- Returns:
- True if the component has been updated, false if not.
-
notifyCompleted
Receive notification that a lifecycle phase, and all successor phases, have been completed on this component.- Parameters:
phase- The completed view lifecycle phase
-
getContext
Context map for the lifecycle element.Any el statements configured for the components properties (e.g. title="@{foo.property}") are evaluated using the el context map. This map will get populated with default objects like the model, view, and request from the
ViewHelperService. Other components can push further objects into the context so that they are available for use with that component. For example, field instances that are part of a collection line as receive the current line instanceContext map also provides objects to methods that are invoked for
GeneratedFieldinstancesThe Map key gives the name of the variable that can be used within expressions, and the Map value gives the object instance for which expressions containing the variable should evaluate against
NOTE: Calling getContext().putAll() will skip updating any configured property replacers for the component. Instead you should call #pushAllToContextDeep
- Returns:
- Mapinvalid input: '<'String, Object> context
-
setContext
- See Also:
-
pushObjectToContext
Places the given object into the context Map for the component with the given nameNote this also will push context to property replacers configured on the component. To place multiple objects in the context, you should use #pushAllToContextDeep since that will call this method for each and update property replacers. Using
Component.getContext().putAll()will bypass property replacers.- Parameters:
objectName- - name the object should be exposed under in the context mapobject- - object instance to place into context
-
pushAllToContext
Places each entry of the given Map into the context for the componentNote this will call #pushObjectToContextDeep for each entry which will update any configured property replacers as well. This should be used in place of getContext().putAll()
- Parameters:
objects- - Mapinvalid input: '<'String, Object> objects to add to context, where the entry key will be the context key and the entry value will be the context value
-
performInitialization
Deprecated.Special processing within this method should be replaced byViewLifecycleTaskand initialized by.invalid reference
#initializePendingTasks(ViewLifecyclePhase, Queue)Initializes the componentWhere 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.
- Parameters:
model- - object instance containing the view data- See Also:
-
performApplyModel
Deprecated.Special processing within this method should be replaced byViewLifecycleTaskand initialized by.invalid reference
#initializePendingTasks(ViewLifecyclePhase, Queue)Called after the initialize phase to perform conditional logic based on the model dataWhere components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
- Parameters:
model- - Top level object containing the data (could be the form or a top level business object, dto)parent- parent lifecycle element
-
performFinalize
Deprecated.Special processing within this method should be replaced byViewLifecycleTaskand initialized by.invalid reference
#initializePendingTasks(ViewLifecyclePhase, Queue)The last phase before the view is renderedHere final preparations can be made based on the updated view state.
- Parameters:
model- - top level object containing the dataparent- - parent component
-
skipLifecycle
boolean skipLifecycle()Return true if the lifecycle should be skipped for this component.Skipping the lifecycle means do not invoke the performInitialize, performApplyModel, and performFinalize methods of this component and its children. This means that content built by those lifecycle tasks will not be processed or applied. Skipping the lifecycle on a component helps initial load/setup performance by only performing the full lifecycle when the component is requested on subsequent requests (ajax retrievals).
- Returns:
- true if lifecycle should be skipped for this component
-
ViewLifecycleTaskand initialized byinvalid reference