org.apache.myfaces.orchestra.conversation.jsf.components
Class UIEndConversation
java.lang.Object
UICommand
org.apache.myfaces.orchestra.conversation.jsf.components.AbstractConversationComponent
org.apache.myfaces.orchestra.conversation.jsf.components.UIEndConversation
public class UIEndConversation
- extends AbstractConversationComponent
Can be used to end a manual-scope conversation, and optionally handles exceptions thrown
by action methods.
When nested within a UICommand component (eg a commandLink or commandButton) the specified
conversation will be ended after the method invoked by the parent component is executed.
<h:commandLink action="#{backing.saveAction}">
<orchestra:endConversation name="conversation1" onOutcome="success" />
</h:commandLink>
The "name" attribute is mandatory, and specifies which conversation is to be ended.
The optional attributes are:
onOutcome
This is a string or comma-separated list of strings. After invoking the action
associated with the nearest ancestor UICommand component, the following rules
are executed:
- If there is no ancestor UICommand component then end the conversation, else
- If the action returned null, then do not end the conversation, else
- If the onOutcomes list is null or empty then end the conversation, else
- If the returned value is in the onOutcomes list then end the conversation, else
- do not end the conversation.
Note in particular that when this component has no enclosing UICommand component, then
the specified conversation is always terminated. This is often useful on the "confirmation"
page of a wizard-style page sequence.
errorOutcome
In case of an exception being thrown by the action method, use the given outcome as the
new outcome so normal navigation to a specified page can occur instead of showing the
default errorPage. This value is checked against the onOutcome list to determine whether
the specified conversation should be terminated when an exception occurs. If an exception
occurs, but no errorOutcome is specified then the conversation is never terminated.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COMPONENT_TYPE
public static final java.lang.String COMPONENT_TYPE
- See Also:
- Constant Field Values
UIEndConversation
public UIEndConversation()
encodeBegin
public void encodeBegin(FacesContext context)
throws java.io.IOException
- Throws:
java.io.IOException
restoreState
public void restoreState(FacesContext context,
java.lang.Object state)
- Overrides:
restoreState
in class AbstractConversationComponent
saveState
public java.lang.Object saveState(FacesContext context)
- Overrides:
saveState
in class AbstractConversationComponent
getOnOutcome
public java.lang.String getOnOutcome()
setOnOutcome
public void setOnOutcome(java.lang.String onOutcome)
getErrorOutcome
public java.lang.String getErrorOutcome()
setErrorOutcome
public void setErrorOutcome(java.lang.String errorOutcome)
Copyright © 2009 The Apache Software Foundation. All Rights Reserved.