org.kuali.rice.krad.uif.field
Class ActionField

java.lang.Object
  extended by org.kuali.rice.krad.uif.component.ConfigurableBase
      extended by org.kuali.rice.krad.uif.component.ComponentBase
          extended by org.kuali.rice.krad.uif.field.FieldBase
              extended by org.kuali.rice.krad.uif.field.ActionField
All Implemented Interfaces:
Serializable, Component, Configurable, ScriptEventSupport, Field, org.springframework.core.Ordered
Direct Known Subclasses:
AjaxActionField

public class ActionField
extends FieldBase

Field that presents an action that can be taken on the UI such as submitting the form or invoking a script

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
ActionField()
           
 
Method Summary
 void addActionParameter(String parameterName, String parameterValue)
          Convenience method to add a parameter to the action parameters Map
 String getActionEvent()
          Name of the event that will be set when the action is invoked
 ActionFieldSecurity getActionFieldSecurity()
          Action Field Security object that indicates what authorization (permissions) exist for the action
 ImageField getActionImage()
          Image to use for the action
 String getActionImageLocation()
           
 String getActionLabel()
          Label text for the action
 String getActionParameter(String parameterName)
          Get an actionParameter by name
 Map<String,String> getActionParameters()
          Parameters that should be sent when the action is invoked
 String getClientSideJs()
          Client side javascript to be executed when this actionField is clicked.
protected  Class<? extends ComponentSecurity> getComponentSecurityClass()
          Returns the security class that is associated with the component (used for initialization and validation)
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the component and should be sent through the lifecycle
 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)
 String getFocusOnAfterSubmit()
          The id of the field to place focus on in the new page after the new page is retrieved.
 String getJumpToIdAfterSubmit()
           
 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.
 LightBox getLightBoxDirectInquiry()
          LightBox widget for the field
 LightBox getLightBoxLookup()
          LightBoxLookup widget for the field
 String getMethodToCall()
          Name of the method that should be called when the action is selected
 String getNavigateToPageId()
          For an ActionField that is part of a NavigationGroup
 boolean getSupportsOnClick()
          Indicates whether the component supports the onClick event
 boolean isBlockValidateDirty()
           
 boolean isClientSideValidate()
          Indicates whether the form data should be validated on the client side return true if validation should occur, false otherwise
 boolean isDisabled()
          Indicates whether the action (input or button) is disabled (doesn't allow interaction)
 void performFinalize(View view, Object model, Component parent)
          The following finalization is performed: Add methodToCall action parameter if set and setup event code for setting action parameters
 void performInitialization(View view, Object model)
          The following initialization is performed: Set the actionLabel if blank to the Field label
 void setActionEvent(String actionEvent)
          Setter for the action event
 void setActionImage(ImageField actionImage)
          Setter for the action image field
 void setActionImageLocation(String actionImageLocation)
          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 the action parameters
 void setBlockValidateDirty(boolean blockValidateDirty)
           
 void setClientSideJs(String clientSideJs)
           
 void setClientSideValidate(boolean clientSideValidate)
          Setter for the client side validation flag
 void setComponentSecurity(ComponentSecurity componentSecurity)
          Override to assert a ActionFieldSecurity instance is set
 void setDisabled(boolean disabled)
          Setter for the disabled indicator
 void setDisabledReason(String disabledReason)
          Setter for the disabled reason text
 void setFocusOnAfterSubmit(String focusOnAfterSubmit)
           
 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)
           
 void setLightBoxDirectInquiry(LightBox lightBoxDirectInquiry)
          Setter for the light box direct inquiry widget
 void setLightBoxLookup(LightBox lightBoxLookup)
          Setter for the light box lookup widget
 void setMethodToCall(String methodToCall)
          Setter for the actions method to call
 void setNavigateToPageId(String navigateToPageId)
          Setter for the navigate to page id
 
Methods inherited from class org.kuali.rice.krad.uif.field.FieldBase
getComponentTypeName, getFieldSecurity, getLabel, getLabelField, getLabelPlacement, getShortLabel, isLabelFieldRendered, setLabel, setLabelField, setLabelFieldRendered, setLabelPlacement, setShortLabel, setShowLabel
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addStyleClass, appendToStyle, getAlign, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, getComponentPrototypes, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getEventCode, getFactoryId, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshDiscloseMethodToCall, getRefreshWhenChanged, getRefreshWhenChangedControlNames, getRenderOutput, getRequired, getRowSpan, getStyle, getStyleClasses, getStyleClassesAsString, getSupportsOnBlur, getSupportsOnChange, getSupportsOnClose, getSupportsOnDblClick, getSupportsOnDocumentReady, getSupportsOnFocus, getSupportsOnKeyDown, getSupportsOnKeyPress, getSupportsOnKeyUp, getSupportsOnLoad, getSupportsOnMouseDown, getSupportsOnMouseMove, getSupportsOnMouseOut, getSupportsOnMouseOver, getSupportsOnMouseUp, getSupportsOnSubmit, getSupportsOnUnload, getTemplate, getTitle, getValign, getWidth, isHidden, isPersistInSession, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, isSkipInTabOrder, performApplyModel, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAlign, setColSpan, setComponentModifiers, setComponentOptions, setComponentOptionsJSString, setConditionalRefresh, setContext, setFactoryId, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setHidden, setId, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPersistInSession, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefresh, setRefreshDiscloseMethodToCall, setRefreshedByAction, setRefreshWhenChanged, setRender, setRenderOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setStyleClasses, setTemplate, setTitle, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 
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
addStyleClass, appendToStyle, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, getComponentPrototypes, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getFactoryId, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshWhenChanged, getRefreshWhenChangedControlNames, getRenderOutput, getRequired, getRowSpan, getStyle, getStyleClasses, getTemplate, getTitle, isHidden, isPersistInSession, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRefreshedByAction, isRender, isResetDataOnRefresh, isSelfRendered, performApplyModel, pushAllToContext, pushObjectToContext, setColSpan, setComponentModifiers, setComponentOptions, setComponentOptionsJSString, setConditionalRefresh, setContext, setFactoryId, setHidden, setId, setOrder, setPersistInSession, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefresh, setRefreshedByAction, setRefreshWhenChanged, setRender, setRenderOutput, setRequired, setResetDataOnRefresh, setRowSpan, setSelfRendered, setStyle, setStyleClasses, setTemplate, setTitle
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 
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, getSupportsOnBlur, getSupportsOnChange, getSupportsOnClose, getSupportsOnDblClick, getSupportsOnDocumentReady, getSupportsOnFocus, getSupportsOnKeyDown, getSupportsOnKeyPress, getSupportsOnKeyUp, getSupportsOnLoad, getSupportsOnMouseDown, getSupportsOnMouseMove, getSupportsOnMouseOut, getSupportsOnMouseOver, getSupportsOnMouseUp, getSupportsOnSubmit, getSupportsOnUnload, setOnBlurScript, setOnDocumentReadyScript, setOnLoadScript
 

Constructor Detail

ActionField

public ActionField()
Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model)
The following initialization is performed:

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

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component parent)
The following finalization is performed:

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

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: Component
List of components that are contained within the component and should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Specified by:
getComponentsForLifecycle in interface Component
Overrides:
getComponentsForLifecycle in class FieldBase
Returns:
List child components
See Also:
ComponentBase.getComponentsForLifecycle()

getMethodToCall

public String getMethodToCall()
Name of the method that should be called when the action is selected

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

Returns:
String name of method to call

setMethodToCall

public void setMethodToCall(String methodToCall)
Setter for the actions method to call

Parameters:
methodToCall -

getActionLabel

public String getActionLabel()
Label text for the action

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

Returns:
String label for action

setActionLabel

public void setActionLabel(String actionLabel)
Setter for the actions label

Parameters:
actionLabel -

getActionImage

public ImageField getActionImage()
Image to use for the action

When the action image field 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

Returns:
ImageField action image

setActionImage

public void setActionImage(ImageField actionImage)
Setter for the action image field

Parameters:
actionImage -

getNavigateToPageId

public String getNavigateToPageId()
For an ActionField that is part of a NavigationGroup Support exists in the UifControllerBase for handling navigation between pages

Returns:
String id of page that should be rendered when the action item is selected

setNavigateToPageId

public void setNavigateToPageId(String navigateToPageId)
Setter for the navigate to page id

Parameters:
navigateToPageId -

getActionEvent

public String getActionEvent()
Name of the event that will be set when the action is invoked

Action events can be looked at by the view or components in order to render differently depending on the action requested.

Returns:
String action event name
See Also:
UifConstants.ActionEvents

setActionEvent

public void setActionEvent(String actionEvent)
Setter for the action event

Parameters:
actionEvent -

getActionParameters

public Map<String,String> getActionParameters()
Parameters that should be sent when the action is invoked

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)

Returns:
Map action parameters

setActionParameters

public void setActionParameters(Map<String,String> actionParameters)
Setter for the action parameters

Parameters:
actionParameters -

addActionParameter

public void addActionParameter(String parameterName,
                               String parameterValue)
Convenience method to add a parameter to the action parameters Map

Parameters:
parameterName - - name of parameter to add
parameterValue - - value of parameter to add

getActionParameter

public String getActionParameter(String parameterName)
Get an actionParameter by name


getActionFieldSecurity

public ActionFieldSecurity getActionFieldSecurity()
Action Field Security object that indicates what authorization (permissions) exist for the action

Returns:
ActionFieldSecurity instance

setComponentSecurity

public void setComponentSecurity(ComponentSecurity componentSecurity)
Override to assert a ActionFieldSecurity instance is set

Specified by:
setComponentSecurity in interface Component
Overrides:
setComponentSecurity in class FieldBase
Parameters:
componentSecurity - - instance of ActionFieldSecurity
See Also:
Component.setComponentSecurity(org.kuali.rice.krad.uif.component.ComponentSecurity)

getComponentSecurityClass

protected Class<? extends ComponentSecurity> getComponentSecurityClass()
Description copied from class: ComponentBase
Returns the security class that is associated with the component (used for initialization and validation)

Overrides:
getComponentSecurityClass in class FieldBase
Returns:
Class
See Also:
ComponentBase.getComponentSecurityClass()

getSupportsOnClick

public boolean getSupportsOnClick()
Description copied from interface: ScriptEventSupport
Indicates whether the component supports the onClick event

Specified by:
getSupportsOnClick in interface ScriptEventSupport
Overrides:
getSupportsOnClick in class ComponentBase
Returns:
boolean true if event is supported, false if the event is not supported
See Also:
ComponentBase.getSupportsOnClick()

setLightBoxLookup

public void setLightBoxLookup(LightBox lightBoxLookup)
Setter for the light box lookup widget

Parameters:
lightBoxLookup - LightBoxLookup widget to set

getLightBoxLookup

public LightBox getLightBoxLookup()
LightBoxLookup widget for the field

The light box lookup widget will change the lookup behaviour to open the lookup in a light box.

Returns:
the DirectInquiry field DirectInquiry

getJumpToIdAfterSubmit

public String getJumpToIdAfterSubmit()
Returns:
the jumpToIdAfterSubmit

setJumpToIdAfterSubmit

public 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. Using "TOP" or "BOTTOM" will jump to the top or the bottom of the resulting page. Passing in nothing for both jumpToIdAfterSubmit and jumpToNameAfterSubmit will result in this ActionField being jumped to by default if it is present on the new page. WARNING: jumpToIdAfterSubmit always takes precedence over jumpToNameAfterSubmit, if set.

Parameters:
jumpToIdAfterSubmit - the jumpToIdAfterSubmit to set

getJumpToNameAfterSubmit

public 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. Passing in nothing for both jumpToIdAfterSubmit and jumpToNameAfterSubmit will result in this ActionField being jumped to by default if it is present on the new page. WARNING: jumpToIdAfterSubmit always takes precedence over jumpToNameAfterSubmit, if set.

Returns:
the jumpToNameAfterSubmit

setJumpToNameAfterSubmit

public void setJumpToNameAfterSubmit(String jumpToNameAfterSubmit)
Parameters:
jumpToNameAfterSubmit - the jumpToNameAfterSubmit to set

getFocusOnAfterSubmit

public String getFocusOnAfterSubmit()
The id of the field to place focus on in the new page after the new page is retrieved. Passing in "FIRST" will focus on the first visible input element on the form. Passing in the empty string will result in this ActionField being focused.

Returns:
the focusOnAfterSubmit

setFocusOnAfterSubmit

public void setFocusOnAfterSubmit(String focusOnAfterSubmit)
Parameters:
focusOnAfterSubmit - the focusOnAfterSubmit to set

isClientSideValidate

public boolean isClientSideValidate()
Indicates whether the form data should be validated on the client side return true if validation should occur, false otherwise


setClientSideValidate

public void setClientSideValidate(boolean clientSideValidate)
Setter for the client side validation flag

Parameters:
clientSideValidate -

getClientSideJs

public String getClientSideJs()
Client side javascript to be executed when this actionField is clicked. This overrides the default action for this ActionField 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.

Returns:
the clientSideJs

setClientSideJs

public void setClientSideJs(String clientSideJs)
Parameters:
clientSideJs - the clientSideJs to set

setLightBoxDirectInquiry

public void setLightBoxDirectInquiry(LightBox lightBoxDirectInquiry)
Setter for the light box direct inquiry widget

Parameters:
lightBoxDirectInquiry - LightBox widget to set

getLightBoxDirectInquiry

public LightBox getLightBoxDirectInquiry()
LightBox widget for the field

The light box widget will change the direct inquiry behaviour to open up in a light box.

Returns:
the LightBox field LightBox

setBlockValidateDirty

public void setBlockValidateDirty(boolean blockValidateDirty)
Parameters:
blockValidateDirty - the blockValidateDirty to set

isBlockValidateDirty

public boolean isBlockValidateDirty()
Returns:
the blockValidateDirty

isDisabled

public boolean isDisabled()
Indicates whether the action (input or button) is disabled (doesn't allow interaction)

Returns:
boolean true if the action field is disabled, false if not

getDisabledReason

public 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)

Returns:
String disabled reason text
See Also:
#isDisabled()}

setDisabledReason

public void setDisabledReason(String disabledReason)
Setter for the disabled reason text

Parameters:
disabledReason -

setDisabled

public void setDisabled(boolean disabled)
Setter for the disabled indicator

Parameters:
disabled -

getActionImageLocation

public String getActionImageLocation()

setActionImageLocation

public void setActionImageLocation(String actionImageLocation)
Set to TOP, BOTTOM, LEFT, RIGHT to position image at that location within the button. For the subclass ActionLinkField only LEFT and RIGHT are allowed. When set to blank/null/IMAGE_ONLY, the image itself will be the ActionField, if no value is set the default is ALWAYS LEFT, you must explicitly set blank/null/IMAGE_ONLY to use ONLY the image as the ActionField.



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