Class DialogGroup
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,Component,Ordered,ScriptEventSupport,Container,Group,LifecycleElement,Helpable,org.springframework.core.Ordered
A dialog group can be used for many different purposes. First it can be used to give a simple confirmation (
a prompt with ok/cancel or yes/no options). The Action component contains
properties for adding a confirmation dialog. Next, a dialog can be used to prompt for a response or to gather
addition data on the client. In this situation, the dialog is configured either in the view or external to the view,
and the developers triggers the display of the dialog using the javascript method showDialog. See krad.modal.js
for more information. Dialogs can also be triggered from a controller method (or other piece of server code). Again
the dialog is configured with the view or external to the view, and the controller method triggers the show using
the method UifControllerBase.showDialog(java.lang.String, boolean, org.kuali.rice.krad.web.form.UifFormBase).
A dialog is a group and can be configured like any other general group. For building basic dialogs, there are convenience properties that can be used. In addition, there are base beans provided with definitions for these properties. This includes a basic prompt message and responses. Note to have responses with different action properties, set the items of the dialog groups footer directly.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.kuali.rice.krad.uif.container.GroupBase
GroupBase.ACTION_VALIDATION_COMPONENTS -
Field Summary
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptionsFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCodeFields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.kuali.rice.core.api.util.KeyValue> List of options that are available for the user to choice as a response to the dialog.Gets CSS class to use when rendering dialog (default is modal-sm).Input field use to gather explanation text with the dialog.Script that will be invoked when the dialog response event is thrown.Script that will get invoked once the dialog group is hidden.Script that will get invoked when the dialog group receives a hide event.Script that will get invoked when the dialog group is shown.Message component to use for the dialog prompt.Text to be displayed as the prompt or main message in this simple dialog.booleanFlag to indicate whether the contents of the dialog should be destroyed on hidden.voidperformApplyModel(Object model, LifecycleElement parent) The following actions are performed in this phase: For each configured key value response, create an action component and add to the footer items. The following updates are done here: Evaluate the progressive render condition (if set) and combine with the current render status to set the render status Called after the initialize phase to perform conditional logic based on the model datavoidperformFinalize(Object model, LifecycleElement parent) The following actions are performed in this phase: Add data attributes for any configured event handlers Sets the section boolean to true if this group has a rendering header with text 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 renderedvoidperformInitialization(Object model) The following actions are performed in this phase: If property name nor binding path is set on the explanation field, sets to generic form property Move custom dialogGroup properties prompt and explanation into items collection if the items list is not already populated 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 componentvoidsetAvailableResponses(List<org.kuali.rice.core.api.util.KeyValue> availableResponses) voidsetDestroyDialogOnHidden(boolean destroyDialogOnHidden) voidsetDialogCssClass(String dialogCssClass) voidsetExplanation(InputField explanation) voidsetOnDialogResponseScript(String onDialogResponseScript) voidsetOnHiddenDialogScript(String onHiddenDialogScript) voidsetOnHideDialogScript(String onHideDialogScript) voidsetOnShowDialogScript(String onShowDialogScript) voidsetPrompt(MessageField prompt) voidsetPromptText(String promptText) Methods inherited from class org.kuali.rice.krad.uif.container.GroupBase
afterEvaluateExpression, buildInputFieldValidationActionScript, completeValidation, getComponentTypeName, getDisclosure, getFieldBindByNamePrefix, getFieldBindingObjectPath, getItems, getScrollpane, getSupportedComponents, getWrapperTag, isAjaxDisclosureGroup, isRenderLoading, setDisclosure, setFieldBindByNamePrefix, setFieldBindingObjectPath, setItems, setNestedComponentId, setScrollpane, setupValidationScripts, setWrapperTag, validateInputFieldMethods inherited from class org.kuali.rice.krad.uif.container.ContainerBase
getAdditionalTemplates, getDefaultItemPosition, getEnterKeyAction, getFooter, getHeader, getHeaderText, getHelp, getHelpTitle, getInstructionalMessage, getInstructionalText, getLayoutManager, getValidationMessages, isProcessRemoteFieldHolders, setDefaultItemPosition, setEnterKeyAction, setFooter, setHeader, setHeaderText, setHelp, setInstructionalMessage, setInstructionalText, setLayoutManager, setRenderFooter, setRenderHeader, setTooltipOfComponent, setValidationMessages, sortItemsMethods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContainerIdSuffix, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContainerIdSuffix, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setExcludeIf, setExcludeUnless, setFieldsToSendOnRefresh, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOmitFromFormPost, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycleMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.uif.component.Component
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFieldsToSendOnRefresh, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOmitFromFormPost, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyleMethods inherited from interface org.kuali.rice.krad.uif.container.Container
getEnterKeyAction, getFooter, getHeader, getInstructionalMessage, getLayoutManager, getValidationMessages, isProcessRemoteFieldHolders, setEnterKeyAction, setFooter, setHeader, setInstructionalMessage, setLayoutManager, setValidationMessages, sortItemsMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.container.Group
getHeaderText, setHeaderText, setRenderFooterMethods inherited from interface org.kuali.rice.krad.uif.widget.Helpable
getHelp, getHelpTitle, setHelp, setTooltipOfComponentMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycleMethods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScriptMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
DialogGroup
public DialogGroup()
-
-
Method Details
-
performInitialization
The following actions are performed in this phase:- If property name nor binding path is set on the explanation field, sets to generic form property
- Move custom dialogGroup properties prompt and explanation into items collection if the items list is not already populated
- Sorts the containers list of components
- Initializes the instructional field if necessary
- Initializes LayoutManager
- Invoke performInitialize on component modifiers
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:
performInitializationin interfaceLifecycleElement- Overrides:
performInitializationin classGroupBase- Parameters:
model- - object instance containing the view data- See Also:
-
performApplyModel
The following actions are performed in this phase:- For each configured key value response, create an action component and add to the footer items.
- Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
- Specified by:
performApplyModelin interfaceLifecycleElement- Overrides:
performApplyModelin classContainerBase- Parameters:
model- - Top level object containing the data (could be the form or a top level business object, dto)parent- parent lifecycle element
-
performFinalize
The following actions are performed in this phase:- Add data attributes for any configured event handlers
- Sets the headerText of the header Group if it is blank
- Set the messageText of the summary Message if it is blank
- Finalizes LayoutManager
- 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
Here final preparations can be made based on the updated view state.
- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classGroupBase- Parameters:
model- - top level object containing the dataparent- - parent component
-
getPromptText
Text to be displayed as the prompt or main message in this simple dialog.This is a convenience method for setting the message text on
getPrompt()- Returns:
- String containing the prompt text
-
setPromptText
- See Also:
-
getPrompt
Message component to use for the dialog prompt.- Returns:
- Message component for prompt
-
setPrompt
- See Also:
-
getExplanation
Input field use to gather explanation text with the dialog.By default, the control for this input is configured as a TextAreaControl. It may be configured for other types of input fields.
- Returns:
- InputField component
-
setExplanation
- See Also:
-
getAvailableResponses
List of options that are available for the user to choice as a response to the dialog.If given, the list of key value pairs is used to create action components that are inserted into the dialog footer. The key will be used as the response value, and the value as the label for the action.
Note responses can be also be created by populating the footer items with action components.
- Returns:
- the List of response actions to provide the user
-
setAvailableResponses
- See Also:
-
getDialogCssClass
Gets CSS class to use when rendering dialog (default is modal-sm).- Returns:
- String of CSS class
-
setDialogCssClass
-
getOnDialogResponseScript
Script that will be invoked when the dialog response event is thrown.The dialog group will throw a custom event type 'dialogresponse.uif' when an response action within the dialog is selected. Script given here will bind to that event as a handler
The event object contains: event.response - response value for the action that was selected event.action - jQuery object for the action element that was selected event.dialogId - id for the dialog the response applies to
- Returns:
- js that will execute for the response event
-
setOnDialogResponseScript
- See Also:
-
getOnShowDialogScript
Script that will get invoked when the dialog group is shown.Initially a dialog group will either be hidden in the DOM or not present at all (if retrieved via Ajax). When the dialog is triggered and shown, a show event will be thrown and this script will be executed
- Returns:
- js code to execute when the dialog is shown
-
setOnShowDialogScript
- See Also:
-
getOnHideDialogScript
Script that will get invoked when the dialog group receives a hide event.- Returns:
- js code to execute when the dialog receives a hide event
-
setOnHideDialogScript
- See Also:
-
getOnHiddenDialogScript
Script that will get invoked once the dialog group is hidden.- Returns:
- js code to execute when the dialog is hidden
-
setOnHiddenDialogScript
- See Also:
-
isDestroyDialogOnHidden
public boolean isDestroyDialogOnHidden()Flag to indicate whether the contents of the dialog should be destroyed on hidden.- Returns:
- boolean to destroy contents
-
setDestroyDialogOnHidden
public void setDestroyDialogOnHidden(boolean destroyDialogOnHidden) - See Also:
-