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

java.lang.Object
  extended by org.kuali.rice.krad.uif.core.ComponentBase
      extended by org.kuali.rice.krad.uif.field.FieldBase
          extended by org.kuali.rice.krad.uif.field.ActionField
All Implemented Interfaces:
Serializable, Component, ScriptEventSupport, Field, org.springframework.core.Ordered

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.core.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
 ImageField getActionImageField()
          Image to use for the action
 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.
 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 getLightBox()
          LightBox widget for the field
 LightBoxLookup 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()
           
 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)
          The following initialization is performed: Set the actionLabel if blank to the Field label
 void setActionImageField(ImageField actionImageField)
          Setter for the action image field
 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 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 setLightBox(LightBox lightBox)
          Setter for the light box widget
 void setLightBoxLookup(LightBoxLookup 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, getLabel, getLabelField, getLabelPlacement, getNestedComponents, getShortLabel, isLabelFieldRendered, setLabel, setLabelField, setLabelFieldRendered, setLabelPlacement, setShortLabel, setShowLabel
 
Methods inherited from class org.kuali.rice.krad.uif.core.ComponentBase
addStyleClass, appendToStyle, getAlign, getBaseId, getColSpan, getComponentModifiers, getComponentOptions, getComponentOptionsJSString, getConditionalColSpan, getConditionalReadOnly, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getConditionalRender, getConditionalRequired, getConditionalRowSpan, getContext, getEventCode, 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, getPropertiesForReferenceCopy, getPropertyExpressions, getPropertyReplacers, 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, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRender, isSelfRendered, isSkipInTabOrder, performApplyModel, pushObjectToContext, setAlign, setBaseId, setColSpan, setComponentModifiers, setComponentOptions, setConditionalColSpan, setConditionalReadOnly, setConditionalRefresh, setConditionalRender, setConditionalRequired, setConditionalRowSpan, setContext, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setHidden, setId, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyExpressions, setPropertyReplacers, setReadOnly, setRefresh, setRefreshWhenChanged, setRender, setRender, setRenderOutput, setRequired, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setStyleClasses, setTemplate, setTitle, setValign, setWidth
 
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.core.Component
addStyleClass, appendToStyle, getBaseId, getColSpan, getComponentModifiers, getComponentOptions, getConditionalReadOnly, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getConditionalRender, getContext, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getOrder, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertiesForReferenceCopy, getPropertyReplacers, getRefreshWhenChanged, getRefreshWhenChangedControlNames, getRenderOutput, getRequired, getRowSpan, getStyle, getStyleClasses, getTemplate, getTitle, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefresh, isRender, isSelfRendered, performApplyModel, pushObjectToContext, setBaseId, setColSpan, setComponentModifiers, setComponentOptions, setConditionalReadOnly, setConditionalRefresh, setConditionalRender, setContext, setHidden, setId, setOrder, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefresh, setRefreshWhenChanged, setRender, setRenderOutput, setRequired, setRowSpan, setSelfRendered, setStyle, setStyleClasses, setTemplate, setTitle
 
Methods inherited from interface org.kuali.rice.krad.uif.core.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
 

Constructor Detail

ActionField

public ActionField()
Method Detail

performInitialization

public void performInitialization(View view)
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
See Also:
ComponentBase.performInitialization(org.kuali.rice.krad.uif.container.View)

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.container.View, java.lang.Object, org.kuali.rice.krad.uif.core.Component)

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 -

getActionImageField

public ImageField getActionImageField()
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

setActionImageField

public void setActionImageField(ImageField actionImageField)
Setter for the action image field

Parameters:
actionImageField -

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 -

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


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(LightBoxLookup lightBoxLookup)
Setter for the light box lookup widget

Parameters:
the - LightBoxLookup widget to set

getLightBoxLookup

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

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

setLightBox

public void setLightBox(LightBox lightBox)
Setter for the light box widget

Parameters:
the - LightBox widget to set

getLightBox

public LightBox getLightBox()
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


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.