Class PmCommandNaviBack

  extended by
      extended by
          extended by
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<PmObject>, PmCommand, PmObject

public class PmCommandNaviBack
extends PmCommandImpl

Navigates back to the previous page.
It is intended for the usual 'Cancel' button functionality. So, it does not trigger PM attribute validation.
That validation may be overridden by subclasses or just by specifying 'requiresValidValues=true' using a PmCommandCfg annotation.

In some cases there might be no previous page. (E.g. in case of an application session that was started by a bookmark.) In this case it navigates back to the (optionally configured) start link.

If both are not available, the command will be disabled.

Attention: This command will only work when the navigation history is enabled.

olaf boede

Nested Class Summary
Nested classes/interfaces inherited from class
Nested classes/interfaces inherited from class
PmObjectBase.NameBuilder, PmObjectBase.NameBuilderAbsoluteName, PmObjectBase.NameBuilderShortName, PmObjectBase.NameBuilderTitle
Nested classes/interfaces inherited from interface
PmCommand.CmdKind, PmCommand.CommandSet, PmCommand.CommandState
Field Summary
Fields inherited from class
Fields inherited from class
Fields inherited from interface
Constructor Summary
PmCommandNaviBack(PmObject pm, org.pm4j.navi.NaviLink... linksToSkip)
Method Summary
protected  void doItImpl()
          Updates the back-navigation link based on the current navigation history state.
protected  boolean isPmEnabledImpl()
          Is only enabled when there is a back-navigation link.
protected  void onPmInit()
          Sets the fix link value before command execution.
Methods inherited from class
accept, actionReturnOnFailure, addCommandDecorator, afterDo, beforeDo, clone, doIt, doIt, doItReturnNextDlgPm, doItReturnString, doItReturnVoid, getCmdKind, getCommandState, getNavigateBackLink, getNaviLink, getNaviLinkImpl, getParentCommands, getUndoCommand, getVetoCommandDecorator, getVisiblePmCommands, initMetaData, isASubCommandEnabled, isASubCommandVisible, isPmVisibleImpl, isRequiresValidValues, makeMetaData, makeOptionalSuccessMsg, navigateBack, navigateTo, setNaviLink, setUndoCommand, validate
Methods inherited from class
addToPmComposite, canSetPmTitle, clearCachedPmValues, clearPmInvalidValues, compareTo, ensurePmMetaDataInitialization, findAnnotationsInPmHierarchy, getPmConversation, getPmConversationImpl, getPmIconPath, getPmMetaData, getPmMetaDataWithoutPmInitCall, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmResKey, getPmResKeyBase, getPmResLoaderCtxtClasses, getPmShortTitle, getPmStyleClasses, getPmStyleClassesImpl, getPmTitle, getPmTitleDef, getPmTitleImpl, getPmTooltip, getPmTooltipImpl, getVisiblePmCommands, isMetaDataInitialized, isPmEnabled, isPmReadonly, isPmReadonlyImpl, isPmValid, isPmVisible, onPmChildStateChange, onPmValueChange, readCacheStrategy, removePmChild, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible, toString
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface
canSetPmTitle, compareTo, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible

Constructor Detail


public PmCommandNaviBack(PmObject pm,
                         org.pm4j.navi.NaviLink... linksToSkip)
pm - The parent PM.
linksToSkip - An optional set of links to skip on back navigation.
Method Detail


protected void onPmInit()
Sets the fix link value before command execution.
That allows to use this command for static web client links that never execute the command and only ask PmCommandImpl.getNaviLink().

But: Be careful if the navigation path changes during the live time of this instance. In this case you should ask only the executed command instance for the real navigation link.

onPmInit in class PmObjectBase


protected boolean isPmEnabledImpl()
Is only enabled when there is a back-navigation link.

isPmEnabledImpl in class PmCommandImpl


protected void doItImpl()
                 throws java.lang.Exception
Updates the back-navigation link based on the current navigation history state.

doItImpl in class PmCommandImpl
java.lang.Exception - In case of an unexpected failure.