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

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.container.ContainerBase
                  extended by org.kuali.rice.krad.uif.container.Group
                      extended by org.kuali.rice.krad.uif.container.DialogGroup
All Implemented Interfaces:
Serializable, Cloneable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Container, Helpable, org.springframework.core.Ordered

public class DialogGroup
extends Group

Special type of Group that presents a the content for a modal dialog

This type of group will be hidden when the main view is displayed. It will be used as content inside the LightBox widget when the modal dialog is displayed. For convenience, this group contains a standard set of components for commonly used modal dialogs

The DialogGroup may also serve as a base class for more complex dialogs. The default settings for this DialogGroup is to display a prompt message with two buttons labeled OK and Cancel. The optional explanation TextAreaControl is hidden by default.

The prompt text, number of user options and their corresponding label are configurable. The InputField for the explanation is TextAreaControl by default. It may be configured to other types of InputFields. The Component for ResponseInputField is a HorizontalCheckboxGroup by default. JQuery styling is then used to style the checkboxes as buttons. The ResponseInputField may be configured to other InputField types.

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
DialogGroup()
           
 
Method Summary
protected
<T> void
copyProperties(T component)
          Copies the properties over for the copy method
 List<KeyValue> getAvailableResponses()
          Gets the choices provided for user response.
 String getEventHandlerScript()
          Override to add the handler script for the dialog response and show dialog events
 InputField getExplanation()
          Retrieves the explanation InputField used to gather user input text from the dialog
 String getOnDialogResponseScript()
          Script that will be invoked when the response event is thrown
 String getOnShowDialogScript()
          Script that will get invoked when the dialog group is shown
 MessageField getPrompt()
          Retrieves the Message element for this dialog
 String getPromptText()
          Returns the text to be displayed as the prompt or main message in this simple dialog
 InputField getResponseInputField()
          Retrieves the InputField containing the choices displayed in this dialog
 boolean isDisplayExplanation()
          determines if the explanation InputField is to be displayed in this dialog
 boolean isReverseButtonOrder()
          Determines the positioning order of the choices displayed on this dialog
 void performApplyModel(View view, Object model, Component parent)
          The following actions are performed in this phase:
 void performFinalize(View view, Object model, Component parent)
          The following actions are performed in this phase:
 void performInitialization(View view, Object model)
          The following actions are performed in this phase: Move custom dialogGroup properties prompt, explanation, and responseInputField into items collection if they are not already present
 void setAvailableResponses(List<KeyValue> availableResponses)
          Sets the list of user responses to provide on this dialog
 void setDisplayExplanation(boolean displayExplanation)
          Sets whether to display the Explanation InputField on this dialog
 void setExplanation(InputField explanation)
          Sets the InputField for gathering user text input
 void setOnDialogResponseScript(String onDialogResponseScript)
          Setter for the 'dialogresponse.uif' event handler code
 void setOnShowDialogScript(String onShowDialogScript)
          Setter for the 'showdialog.uif' event handler code
 void setPrompt(MessageField prompt)
          Sets the prompt Message for this dialog
 void setPromptText(String promptText)
          Sets the text String to display as the main message in this dialog
 void setResponseInputField(InputField responseInputField)
          Sets the type of InputField used to display the user choices in this dialog
 void setReverseButtonOrder(boolean reverseButtonOrder)
          Sets the display order of the choices displayed on this dialog
 
Methods inherited from class org.kuali.rice.krad.uif.container.Group
completeValidation, getComponentsForLifecycle, getComponentTypeName, getDisclosure, getFieldBindByNamePrefix, getFieldBindingObjectPath, getItems, getScrollpane, getSupportedComponents, setDisclosure, setFieldBindByNamePrefix, setFieldBindingObjectPath, setItems, setScrollpane
 
Methods inherited from class org.kuali.rice.krad.uif.container.ContainerBase
getComponentPrototypes, getDefaultItemPosition, getFooter, getHeader, getHeaderText, getHelp, getHelpTitle, getInstructionalMessage, getInstructionalText, getLayoutManager, getValidationMessages, setDefaultItemPosition, setFooter, setHeader, setHeaderText, setHelp, setInstructionalMessage, setInstructionalText, setLayoutManager, setRenderFooter, setRenderHeader, setTooltipOfComponent, setValidationMessages, sortItems
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getComponentSecurityClass, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, isUseAjaxCallForContent, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setUseAjaxCallForContent, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getLabelFromCamelCasedName, getNamespaceCode, setComponentCode, setNamespaceCode
 
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.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isUseAjaxCallForContent, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setUseAjaxCallForContent, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
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, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Constructor Detail

DialogGroup

public DialogGroup()
Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model)
The following actions are performed in this phase:

Specified by:
performInitialization in interface Component
Overrides:
performInitialization in class Group
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)
The following actions are performed in this phase:

Specified by:
performApplyModel in interface Component
Overrides:
performApplyModel in class ContainerBase
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 actions are performed in this phase:

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ContainerBase
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)

getEventHandlerScript

public String getEventHandlerScript()
Override to add the handler script for the dialog response and show dialog events

Specified by:
getEventHandlerScript in interface Component
Overrides:
getEventHandlerScript in class ComponentBase
Returns:
JS event handler script
See Also:
Component.getEventHandlerScript()

getPromptText

public String getPromptText()
Returns the text to be displayed as the prompt or main message in this simple dialog

Returns:
String containing the prompt text

setPromptText

public void setPromptText(String promptText)
Sets the text String to display as the main message in this dialog

Parameters:
promptText - the String to be displayed as the main message

getPrompt

public MessageField getPrompt()
Retrieves the Message element for this dialog

Returns:
Message the text element containing the message string

setPrompt

public void setPrompt(MessageField prompt)
Sets the prompt Message for this dialog

Parameters:
prompt - The Message element for this dialog

getExplanation

public InputField getExplanation()
Retrieves the explanation InputField used to gather user input text from 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

public void setExplanation(InputField explanation)
Sets the InputField for gathering user text input

Parameters:
explanation - InputField

isDisplayExplanation

public boolean isDisplayExplanation()
determines if the explanation InputField is to be displayed in this dialog

False by default.

Returns:
true if this user input is to be rendered, false if not

setDisplayExplanation

public void setDisplayExplanation(boolean displayExplanation)
Sets whether to display the Explanation InputField on this dialog

Parameters:
displayExplanation - true if explanation control is to be displayed, false if not

getAvailableResponses

public List<KeyValue> getAvailableResponses()
Gets the choices provided for user response.

A List of KeyValue pairs for each of the choices provided on this dialog.

Returns:
the List of response actions to provide the user

setAvailableResponses

public void setAvailableResponses(List<KeyValue> availableResponses)
Sets the list of user responses to provide on this dialog

Parameters:
availableResponses - a List of KeyValue pairs representing the user response choices

getResponseInputField

public InputField getResponseInputField()
Retrieves the InputField containing the choices displayed in this dialog

By default, this InputField is configured to be a HorizontalCheckboxControl. Styling is then used to make the checkboxes appear to be buttons. The values of the availableResponses List are used as labels for the "buttons".

Returns:
InputField component within this dialog

setResponseInputField

public void setResponseInputField(InputField responseInputField)
Sets the type of InputField used to display the user choices in this dialog

Parameters:
responseInputField - a component used to display the response choices

isReverseButtonOrder

public boolean isReverseButtonOrder()
Determines the positioning order of the choices displayed on this dialog

Some page designers like the positive choice on the left and the negative choice on the right. Others, prefer just the opposite. This allows the order to easily be switched.

Returns:
true if choices left to right false if choices right to left

setReverseButtonOrder

public void setReverseButtonOrder(boolean reverseButtonOrder)
Sets the display order of the choices displayed on this dialog

By default, the choices are displayed left to right

Parameters:
reverseButtonOrder - true if buttons displayed left to right, false if right to left

getOnDialogResponseScript

public String getOnDialogResponseScript()
Script that will be invoked when the response event is thrown

The dialog group will throw a custom event type 'dialogresponse.uif' when a change occurs for the response input field (for example one of the response options is selected). Script given here will bind to that event as a handler

Returns:
javascript that will execute for the response event

setOnDialogResponseScript

public void setOnDialogResponseScript(String onDialogResponseScript)
Setter for the 'dialogresponse.uif' event handler code

Parameters:
onDialogResponseScript -

getOnShowDialogScript

public String 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, the 'showdialog.uif' event will be thrown and this script will be executed

Returns:
JavaScript code to execute when the dialog is shown

setOnShowDialogScript

public void setOnShowDialogScript(String onShowDialogScript)
Setter for the 'showdialog.uif' event handler code

Parameters:
onShowDialogScript -

copyProperties

protected <T> void copyProperties(T component)
Description copied from class: ComponentBase
Copies the properties over for the copy method

Overrides:
copyProperties in class Group
Parameters:
component - base bean
See Also:
ComponentBase.copy()


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