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:
  EventListener, javax.faces.component.ActionSource, javax.faces.component.ActionSource2, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder

    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 String` | `COMPONENT_TYPE`

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

Fields inherited from class javax.faces.component.UIComponent
`BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY`

Constructor Summary
`UIEndConversation()`

Method Summary
`void` | `encodeBegin(javax.faces.context.FacesContext context)`
`String` | `getErrorOutcome()`
`String` | `getOnOutcome()`
`void` | `restoreState(javax.faces.context.FacesContext context, Object state)`
`Object` | `saveState(javax.faces.context.FacesContext context)`
`void` | `setErrorOutcome(String errorOutcome)`
`void` | `setOnOutcome(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, clearInitialState, getAction, getActionExpression, getActionListener, getActionListeners, getValue, isImmediate, markInitialState, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue`

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

Methods inherited from class javax.faces.component.UIComponent
`encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent, visitTree`

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

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

### restoreState

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

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

### saveState

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

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

### getOnOutcome

    public String getOnOutcome()

### setOnOutcome

    public void setOnOutcome(String onOutcome)

### getErrorOutcome

    public String getErrorOutcome()

### setErrorOutcome

    public void setErrorOutcome(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 © 2012 The Apache Software Foundation. All Rights Reserved.