Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.orchestra.conversation.jsf.components
Class UIEndConversation

    java.lang.Object
      javax.faces.component.UIComponent
          javax.faces.component.UIComponentBase
              javax.faces.component.UICommand
                  org.apache.myfaces.orchestra.conversation.jsf.components.AbstractConversationComponent
                      org.apache.myfaces.orchestra.conversation.jsf.components.UIEndConversation

All Implemented Interfaces:
  javax.faces.component.ActionSource, javax.faces.component.StateHolder

    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
- errorOutcome

## 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.

Field Summary
`static java.lang.String` | `COMPONENT_TYPE`

Fields inherited from class org.apache.myfaces.orchestra.conversation.jsf.components.AbstractConversationComponent
`COMPONENT_FAMILY`

Constructor Summary
`UIEndConversation()`

Method Summary
`void` | `encodeBegin(javax.faces.context.FacesContext context)`
`java.lang.String` | `getErrorOutcome()`
`java.lang.String` | `getOnOutcome()`
`void` | `restoreState(javax.faces.context.FacesContext context, java.lang.Object state)`
`java.lang.Object` | `saveState(javax.faces.context.FacesContext context)`
`void` | `setErrorOutcome(java.lang.String errorOutcome)`
`void` | `setOnOutcome(java.lang.String onOutcome)`

Methods inherited from class org.apache.myfaces.orchestra.conversation.jsf.components.AbstractConversationComponent
`getFamily, getName, setName`

Methods inherited from class javax.faces.component.UICommand
`addActionListener, broadcast, getAction, getActionListener, getActionListeners, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionListener, setImmediate, setValue`

Methods inherited from class javax.faces.component.UIComponentBase
`addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### COMPONENT_TYPE

    public static final java.lang.String COMPONENT_TYPE

See Also:
  Constant Field Values

Constructor Detail

### UIEndConversation

    public UIEndConversation()

Method Detail

### encodeBegin

    public void encodeBegin(javax.faces.context.FacesContext context)
                     throws java.io.IOException

  Overrides:
    `encodeBegin` in class `javax.faces.component.UIComponentBase`
  Throws:
    `java.io.IOException`

### restoreState

    public void restoreState(javax.faces.context.FacesContext context,
                             java.lang.Object state)

  Specified by:
    `restoreState` in interface `javax.faces.component.StateHolder`
  Overrides:
    `restoreState` in class `AbstractConversationComponent`

### saveState

    public java.lang.Object saveState(javax.faces.context.FacesContext context)

  Specified by:
    `saveState` in interface `javax.faces.component.StateHolder`
  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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation. All Rights Reserved.