|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.datadictionary.DictionaryBeanBase org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase org.kuali.rice.krad.uif.component.ComponentBase org.kuali.rice.krad.uif.element.ContentElementBase org.kuali.rice.krad.uif.element.Action
public class Action
Field that presents an action that can be taken on the UI such as submitting the form or invoking a script.
Field Summary |
---|
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase |
---|
templateOptions |
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
componentCode, namespaceCode |
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 | |
---|---|
Action()
Sets initial field values and initializes collections. |
Method Summary | |
---|---|
protected void |
addActionDataSettingsValue(Map<String,String> valueMap,
Map<String,String> defaults,
String key,
String value)
Adds the value passed to the valueMap with the key specified, if the value does not match the value which already exists in defaults (to avoid having to write out extra data that can later be derived from the defaults in the js client-side). |
void |
addActionParameter(String parameterName,
String parameterValue)
Convenience method to add a parameter to the action parameters Map. |
protected void |
buildActionData(View view,
Object model,
LifecycleElement parent)
Builds the data attributes that will be read client side to determine how to handle the action and the additional data that should be submitted with the action |
void |
completeValidation(ValidationTrace tracer)
Validates different requirements of component compiling a series of reports detailing information on errors found in the component. |
String |
getActionEvent()
Name of the event that will be set when the action is invoked |
String |
getActionIconPlacement()
Gets the action icon placement. |
Image |
getActionImage()
Image to use for the action |
String |
getActionImagePlacement()
Gets the action image placement. |
String |
getActionLabel()
Label text for the action |
String |
getActionParameter(String parameterName)
Gets an action parameter by name. |
Map<String,String> |
getActionParameters()
Parameters that should be sent when the action is invoked |
String |
getActionScript()
Client side javascript to be executed when this actionField is clicked. |
ActionSecurity |
getActionSecurity()
Action Security object that indicates what authorization (permissions) exist for the action. |
UrlInfo |
getActionUrl()
Url to open when the action item is selected |
Map<String,String> |
getAdditionalSubmitData()
Map of additional data that will be posted when the action is invoked. |
String |
getAjaxReturnType()
Gets the return type for the ajax call |
List<String> |
getDisabledConditionControlNames()
Gets a list of control names to add handlers to for disable functionality, cannot be set. |
String |
getDisabledConditionJs()
Get the disable condition js derived from the springEL, cannot be set. |
String |
getDisabledReason()
If the action field is disabled, gives a reason for why which will be displayed as a tooltip on the action field (button). |
List<String> |
getDisabledWhenChangedPropertyNames()
Gets the property names of fields that when changed, will disable this component. |
List<String> |
getEnabledWhenChangedPropertyNames()
Gets the property names of fields that when changed, will enable this component. |
String |
getErrorCallback()
Gets the script which will be invoked when the action fails due to problems in the ajax call or the return of an incident report |
String |
getFocusOnIdAfterSubmit()
The element to place focus on in the new page after the new page is retrieved. |
String |
getIconClass()
The css class (some which exist in bootstrap css) to use to render an icon for this action. |
String |
getJumpToIdAfterSubmit()
Gets the id to jump to after submit. |
String |
getJumpToNameAfterSubmit()
The name to jump to in the next page, the element with this name will be jumped to automatically when the new page is retrieved after a submit. |
String |
getLoadingMessageText()
Gets the loading message used by action's blockUI. |
String |
getMethodToCall()
Name of the method that should be called when the action is selected |
String |
getNavigateToPageId()
For an Action that is part of a
NavigationGroup , the navigate to page id can be set to
configure the page that should be navigated to when the action is
selected. |
String |
getPreSubmitCall()
Gets the script which needs to be invoked before the form is submitted |
String |
getRefreshId()
Id for the component that should be refreshed after the action completes |
String |
getRefreshPropertyName()
Property name for the DataField that should be refreshed after the action
completes |
String |
getSuccessCallback()
Gets the script which will be invoked on a successful ajax call |
protected void |
initializeComponentSecurity()
Initializes (if necessary) the component security instance for the component type |
boolean |
isAjaxSubmit()
When this property is set to true it will submit the form using Ajax instead of the browser submit. |
boolean |
isClearDirtyOnAction()
True to make this action clear the dirty flag before submitting. |
boolean |
isDirtyOnAction()
When true, this action will mark the form dirty by incrementing the dirty field count, but if this action refreshes the entire view this will be lost (most actions only refresh the page) |
boolean |
isDisableBlocking()
Indicates whether blocking for the action should be disabled |
boolean |
isDisabled()
Indicates whether the action (input or button) is disabled (doesn't allow interaction). |
boolean |
isDisplayResponseInLightBox()
Indicates if the action response should be displayed in a lightbox. |
boolean |
isEvaluateDisabledOnKeyUp()
Evaluate the disable condition on controls which disable it on each key up event. |
boolean |
isPerformActionAuthz()
Indicates whether or not to perform action auth. |
boolean |
isPerformClientSideValidation()
Indicates whether the form data should be validated on the client side. |
boolean |
isPerformDirtyValidation()
Indicates whether or not to perform dirty validation. |
boolean |
isPerformLineActionAuthz()
Indicates whether or not to perform line action auth. |
boolean |
isRenderInnerTextSpan()
When true, a span will be rendered around the actionLabel text. |
void |
performApplyModel(Object model,
LifecycleElement parent)
Sets the disabledExpression, if any, evaluates it and sets the disabled property. |
void |
performFinalize(Object model,
LifecycleElement parent)
The following finalization is performed: Add methodToCall action parameter if set and setup event code for setting action parameters Invoke method to build the data attributes and submit data for the action Compose the final onclick script for the action Parses the disabled expressions, if any, to equivalent javascript and evaluates the disable/enable when changed property names 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 |
void |
setActionEvent(String actionEvent)
Setter for getActionEvent() . |
void |
setActionIconPlacement(String actionIconPlacement)
Setter for getActionIconPlacement() . |
void |
setActionImage(Image actionImage)
Setter for the action image field. |
void |
setActionImagePlacement(String actionImagePlacement)
Set to TOP, BOTTOM, LEFT, RIGHT to position image at that location within the button. |
void |
setActionLabel(String actionLabel)
Setter for the actions label. |
void |
setActionParameters(Map<String,String> actionParameters)
Setter for getActionParameters() . |
void |
setActionScript(String actionScript)
Setter for getActionScript() . |
void |
setActionUrl(UrlInfo actionUrl)
Setter for getActionUrl() . |
void |
setAdditionalSubmitData(Map<String,String> additionalSubmitData)
Setter for map holding additional data to post. |
void |
setAjaxReturnType(String ajaxReturnType)
Setter for the type of ajax return. |
void |
setAjaxSubmit(boolean ajaxSubmit)
Setter for isAjaxSubmit() . |
void |
setClearDirtyOnAction(boolean clearDirtyOnAction)
Setter for isClearDirtyOnAction() . |
void |
setComponentSecurity(ComponentSecurity componentSecurity)
Override to assert a ActionSecurity instance is set. |
void |
setDirtyOnAction(boolean dirtyOnAction)
Set to true, if this action is considered one that changes the form's data (makes the form dirty). |
void |
setDisableBlocking(boolean disableBlocking)
Setter for disabling blocking when the action is invoked. |
void |
setDisabled(boolean disabled)
Setter for the disabled indicator. |
void |
setDisabledConditionControlNames(List<String> disabledConditionControlNames)
Set disabled condition control names. |
protected void |
setDisabledConditionJs(String disabledConditionJs)
Sets the disabled condition javascript. |
protected void |
setDisabledExpression(String disabledExpression)
Sets the disabled expression. |
void |
setDisabledReason(String disabledReason)
Setter for the disabled reason text. |
void |
setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames)
Sets the property names of fields that when changed, will disable this component. |
void |
setDisplayResponseInLightBox(boolean displayResponseInLightBox)
Setter for indicating the response should be rendered in a lightbox. |
void |
setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames)
Sets the property names of fields that when changed, will enable this component. |
void |
setErrorCallback(String errorCallback)
Setter for getErrorCallback() . |
void |
setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp)
Setter for isEvaluateDisabledOnKeyUp() . |
void |
setFocusOnIdAfterSubmit(String focusOnIdAfterSubmit)
Setter for getFocusOnIdAfterSubmit() . |
void |
setIconClass(String iconClass)
Setter for getIconClass() . |
void |
setJumpToIdAfterSubmit(String jumpToIdAfterSubmit)
The id to jump to in the next page, the element with this id will be jumped to automatically when the new page is retrieved after a submit. |
void |
setJumpToNameAfterSubmit(String jumpToNameAfterSubmit)
Setter for getJumpToIdAfterSubmit() . |
void |
setLoadingMessageText(String loadingMessageText)
When this property is set, it is used in place of the loading message text used by the blockUI. |
void |
setMethodToCall(String methodToCall)
Setter for the actions method to call. |
void |
setNavigateToPageId(String navigateToPageId)
Setter for getNavigateToPageId() . |
void |
setPerformActionAuthz(boolean performActionAuthz)
Setter for isPerformActionAuthz() . |
void |
setPerformClientSideValidation(boolean performClientSideValidation)
Setter for the client side validation flag. |
void |
setPerformDirtyValidation(boolean performDirtyValidation)
Setter for isPerformDirtyValidation() . |
void |
setPerformLineActionAuthz(boolean performLineActionAuthz)
Setter for isPerformActionAuthz() . |
void |
setPreSubmitCall(String preSubmitCall)
Setter for getPreSubmitCall() . |
void |
setRefreshId(String refreshId)
Setter for the getRefreshId() . |
void |
setRefreshPropertyName(String refreshPropertyName)
Setter for the property name of the DataField that should be refreshed. |
void |
setRenderInnerTextSpan(boolean renderInnerTextSpan)
Setter for isRenderInnerTextSpan() . |
void |
setSuccessCallback(String successCallback)
Setter for successCallback. |
protected void |
setupRefreshAction(View view)
When the action is updating a component sets up the refresh script for the component (found by the given refresh id or refresh property name. |
Methods inherited from class org.kuali.rice.krad.uif.element.ContentElementBase |
---|
getComponentTypeName |
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions |
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase |
---|
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean |
---|
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions |
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean |
---|
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode |
Methods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement |
---|
checkMutable, getContainerIdSuffix, getContext, getId, getPhasePathMapping, getViewPath, getViewStatus, initializePendingTasks, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setContext, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycle |
Methods inherited from interface org.kuali.rice.krad.datadictionary.Copyable |
---|
clone |
Constructor Detail |
---|
public Action()
Method Detail |
---|
public void performApplyModel(Object model, LifecycleElement parent)
performApplyModel
in interface LifecycleElement
performApplyModel
in class ComponentBase
model
- top level object containing the data (could be the form or aparent
- parent componentpublic void performFinalize(Object model, LifecycleElement parent)
Here final preparations can be made based on the updated view state.
performFinalize
in interface LifecycleElement
performFinalize
in class ComponentBase
model
- - top level object containing the dataparent
- - parent componentprotected void setupRefreshAction(View view)
view
- view instance the action belongs toprotected void buildActionData(View view, Object model, LifecycleElement parent)
Note these data attributes will be exposed as a data map client side. The simple attributes (non object value) are also written out as attributes on the action element.
view
- view instance the action belongs tomodel
- model object containing the view dataparent
- component the holds the actionprotected void addActionDataSettingsValue(Map<String,String> valueMap, Map<String,String> defaults, String key, String value)
valueMap
- the data map being constructeddefaults
- defaults for validation messageskey
- the variable name being addedvalue
- the value set on this object as a String equivalentpublic String getMethodToCall()
For a server side call (clientSideCall is false), gives the name of the method in the mapped controller that should be invoked when the action is selected. For client side calls gives the name of the script function that should be invoked when the action is selected
public void setMethodToCall(String methodToCall)
methodToCall
- method to callpublic String getActionLabel()
The label text is used by the template renderers to give a human readable label for the action. For buttons this generally is the button text, while for an action link it would be the links displayed text
public void setActionLabel(String actionLabel)
actionLabel
- action labelpublic boolean isRenderInnerTextSpan()
public void setRenderInnerTextSpan(boolean renderInnerTextSpan)
isRenderInnerTextSpan()
.
renderInnerTextSpan
- property valuepublic Image getActionImage()
When the action image component is set (and render is true) the image will be used to present the action as opposed to the default (input submit). For action link templates the image is used for the link instead of the action link text
public void setActionImage(Image actionImage)
actionImage
- action imagepublic String getIconClass()
public void setIconClass(String iconClass)
getIconClass()
.
iconClass
- property valuepublic String getNavigateToPageId()
Action
that is part of a
NavigationGroup
, the navigate to page id can be set to
configure the page that should be navigated to when the action is
selected.
Support exists in the UifControllerBase
for handling
navigation between pages.
public void setNavigateToPageId(String navigateToPageId)
getNavigateToPageId()
.
navigateToPageId
- property valuepublic String getActionEvent()
Action events can be looked at by the view or components in order to render differently depending on the action requested.
UifConstants.ActionEvents
public void setActionEvent(String actionEvent)
getActionEvent()
.
actionEvent
- property valuepublic Map<String,String> getAdditionalSubmitData()
Each entry in this map will be sent as a request parameter when the action is chosen. Note this in addition to the form data that is sent. For example, suppose the model contained a property named number and a boolean named showActive, we can send values for this properties by adding the following entries to this map: {'number':'a13', 'showActive', 'true'}
The additionalSubmitData map is different from the actionParameters map. All name/value pairs given as actionParameters populated the form map actionParameters. While name/value pair given in additionalSubmitData populate different form (model) properties.
public void setAdditionalSubmitData(Map<String,String> additionalSubmitData)
additionalSubmitData
- property valuepublic Map<String,String> getActionParameters()
Action renderer will decide how the parameters are sent for the action (via script generated hiddens, or script parameters, ...)
Can be set by other components such as the CollectionGroup
to provide the context the action is in (such as the collection name and
line the action applies to)
public void setActionParameters(Map<String,String> actionParameters)
getActionParameters()
.
actionParameters
- property valuepublic void addActionParameter(String parameterName, String parameterValue)
parameterName
- name of parameter to addparameterValue
- value of parameter to addpublic String getActionParameter(String parameterName)
parameterName
- parameter name
public ActionSecurity getActionSecurity()
public void setComponentSecurity(ComponentSecurity componentSecurity)
ActionSecurity
instance is set.
setComponentSecurity
in interface Component
setComponentSecurity
in class ComponentBase
componentSecurity
- instance of ActionSecurityprotected void initializeComponentSecurity()
initializeComponentSecurity
in class ComponentBase
public boolean isPerformActionAuthz()
public void setPerformActionAuthz(boolean performActionAuthz)
isPerformActionAuthz()
.
performActionAuthz
- property valuepublic boolean isPerformLineActionAuthz()
public void setPerformLineActionAuthz(boolean performLineActionAuthz)
isPerformActionAuthz()
.
performLineActionAuthz
- property valuepublic String getJumpToIdAfterSubmit()
public void setJumpToIdAfterSubmit(String jumpToIdAfterSubmit)
jumpToIdAfterSubmit
- the jumpToIdAfterSubmit to setpublic String getJumpToNameAfterSubmit()
public void setJumpToNameAfterSubmit(String jumpToNameAfterSubmit)
getJumpToIdAfterSubmit()
.
jumpToNameAfterSubmit
- the jumpToNameAfterSubmit to setpublic String getFocusOnIdAfterSubmit()
The following are allowed:
public void setFocusOnIdAfterSubmit(String focusOnIdAfterSubmit)
getFocusOnIdAfterSubmit()
.
focusOnIdAfterSubmit
- the focusOnAfterSubmit to setpublic boolean isPerformClientSideValidation()
public void setPerformClientSideValidation(boolean performClientSideValidation)
performClientSideValidation
- property valuepublic String getActionScript()
This overrides the default action for this Action so the method called must explicitly submit, navigate, etc. through js, if necessary. In addition, this js occurs AFTER onClickScripts set on this field, it will be the last script executed by the click event. Sidenote: This js is always called after hidden actionParameters and methodToCall methods are written by the js to the html form.
public void setActionScript(String actionScript)
getActionScript()
.
actionScript
- the actionScript to setpublic UrlInfo getActionUrl()
This makes the action behave like a standard link. Instead of posting the form, the configured URL will simply be opened (using window.open). For using standard post actions these does not need to be configured.
public void setActionUrl(UrlInfo actionUrl)
getActionUrl()
.
actionUrl
- property valuepublic void setPerformDirtyValidation(boolean performDirtyValidation)
isPerformDirtyValidation()
.
performDirtyValidation
- the blockValidateDirty to setpublic boolean isPerformDirtyValidation()
public boolean isClearDirtyOnAction()
This will clear both the dirtyForm flag on the form and the count of fields considered dirty on the client-side. This will only be performed if this action is a request based action.
public void setClearDirtyOnAction(boolean clearDirtyOnAction)
isClearDirtyOnAction()
.
clearDirtyOnAction
- property valuepublic boolean isDirtyOnAction()
This will increase count of fields considered dirty on the client-side by 1. This will only be performed if this action is a request based action.
public void setDirtyOnAction(boolean dirtyOnAction)
dirtyOnAction
- property valuepublic boolean isDisabled()
public void setDisabled(boolean disabled)
disabled
- property valuepublic String getDisabledReason()
isDisabled()
public void setDisabledReason(String disabledReason)
disabledReason
- property valuepublic String getActionImagePlacement()
public void setActionImagePlacement(String actionImagePlacement)
actionImagePlacement
- action image placement indicatorpublic String getActionIconPlacement()
public void setActionIconPlacement(String actionIconPlacement)
getActionIconPlacement()
.
actionIconPlacement
- property valuepublic String getPreSubmitCall()
The preSubmitCall can carry out custom logic for the action before the submit occurs. The value should be given as one or more lines of script and should return a boolean. If false is returned from the call, the submit is not carried out. Furthermore, the preSubmitCall can refer to the request object through the variable 'kradRequest' or 'this'. This gives full access over the request for doing such things as adding additional data
Examples 'return doFunction(kradRequest);', 'var valid=true;return valid;'
The preSubmit call will be invoked both for ajax and non-ajax submits
public void setPreSubmitCall(String preSubmitCall)
getPreSubmitCall()
.
preSubmitCall
- property valuepublic boolean isAjaxSubmit()
public void setAjaxSubmit(boolean ajaxSubmit)
isAjaxSubmit()
.
ajaxSubmit
- property valuepublic String getAjaxReturnType()
The ajax return type indicates how the response content will be handled in the client. Typical examples include updating a component, the page, or doing a redirect.
UifConstants.AjaxReturnTypes
public void setAjaxReturnType(String ajaxReturnType)
ajaxReturnType
- property valuepublic boolean isDisplayResponseInLightBox()
public void setDisplayResponseInLightBox(boolean displayResponseInLightBox)
displayResponseInLightBox
- property valuepublic String getSuccessCallback()
The successCallback can carry out custom logic after a successful ajax submission has been made. The value can contain one or more script statements. In addition, the response contents can be accessed through the variable 'responseContents'
Examples 'handleSuccessfulUpdate(responseContents);'
The successCallback may only be specified when isAjaxSubmit()
is true
public void setSuccessCallback(String successCallback)
successCallback
- property valuepublic String getErrorCallback()
The errorCallback can carry out custom logic after a failed ajax submission. The value can contain one or more script statements. In addition, the response contents can be accessed through the variable 'responseContents'
Examples 'handleFailedUpdate(responseContents);'
The errorCallback may only be specified when isAjaxSubmit()
is true
public void setErrorCallback(String errorCallback)
getErrorCallback()
.
errorCallback
- property valuepublic String getRefreshId()
Either refresh id or refresh property name can be set to configure the component that should be refreshed after the action completes. If both are blank, the page will be refreshed
public void setRefreshId(String refreshId)
getRefreshId()
.
refreshId
- property valuepublic String getRefreshPropertyName()
DataField
that should be refreshed after the action
completes
Either refresh id or refresh property name can be set to configure the component that should be refreshed after the action completes. If both are blank, the page will be refreshed
Property name will be adjusted to use the default binding path unless it contains the form prefix
UifConstants.NO_BIND_ADJUST_PREFIX
public void setRefreshPropertyName(String refreshPropertyName)
refreshPropertyName
- property valuepublic String getLoadingMessageText()
public void setLoadingMessageText(String loadingMessageText)
loadingMessageText
- property valuepublic boolean isDisableBlocking()
By default when an action is invoked part of the page or the entire window is blocked until the action completes. If this property is set to true the blocking will not be displayed.
Currently if an action returns a file download, this property should be set to true. If not, the blocking will never get unblocked (because the page does not get notification a file was downloaded)
public void setDisableBlocking(boolean disableBlocking)
disableBlocking
- property valuepublic boolean isEvaluateDisabledOnKeyUp()
public void setEvaluateDisabledOnKeyUp(boolean evaluateDisabledOnKeyUp)
isEvaluateDisabledOnKeyUp()
.
evaluateDisabledOnKeyUp
- property valuepublic String getDisabledConditionJs()
protected void setDisabledConditionJs(String disabledConditionJs)
disabledConditionJs
- property valuepublic List<String> getDisabledConditionControlNames()
public void setDisabledConditionControlNames(List<String> disabledConditionControlNames)
disabledConditionControlNames
- property valuepublic List<String> getDisabledWhenChangedPropertyNames()
public void setDisabledWhenChangedPropertyNames(List<String> disabledWhenChangedPropertyNames)
disabledWhenChangedPropertyNames
- property valuepublic List<String> getEnabledWhenChangedPropertyNames()
public void setEnabledWhenChangedPropertyNames(List<String> enabledWhenChangedPropertyNames)
enabledWhenChangedPropertyNames
- property valueprotected void setDisabledExpression(String disabledExpression)
disabledExpression
- property valuepublic void completeValidation(ValidationTrace tracer)
completeValidation
in interface Component
completeValidation
in class ComponentBase
tracer
- Record of component's location
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |