org.omnifaces.component.input
Class Form

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIForm
              extended by org.omnifaces.component.input.Form
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.UniqueIdVendor, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder

public class Form
extends javax.faces.component.UIForm

Form is a component that extends the standard UIForm and provides a way to keep view parameters in the request URL after a post-back and offers in combination with the <o:ignoreValidationFailed> tag on an UICommand component the possibility to ignore validation failures so that the invoke action phase will be executed anyway.

You can use it the same way as <h:form>, you only need to change h: to o:.

Include View Params

The standard UIForm doesn't put the original view parameters in the action URL that's used for the post-back. Instead, it relies on those view parameters to be stored in the state associated with the standard UIViewParameter. Via this state those parameters are invisibly re-applied after every post-back.

The disadvantage of this invisible retention of view parameters is that the user doesn't see them anymore in the address bar of the browser that is used to interact with the faces application. Copy-pasting the URL from the address bar or refreshing the page by hitting enter inside the address bar will therefore not always yield the expected results.

To solve this, this component offers an attribute includeViewParams that will optionally include all view parameters, in exactly the same way that this can be done for <h:link> and <h:button>.

Ignore Validation Failed

In order to properly use the <o:ignoreValidationFailed> tag on an UICommand component, its parent <h:form> component has to be replaced by this <o:form> component. See also IgnoreValidationFailed.

Since:
1.1
Author:
Arjan Tijms, Bauke Scholtz

Field Summary
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIForm
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
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Form()
           
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context)
           
 java.lang.Boolean isIncludeViewParams()
          Return whether or not the view parameters should be encoded into the form's action URL.
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void setIncludeViewParams(boolean includeViewParams)
          Set whether or not the view parameters should be encoded into the form's action URL.
 
Methods inherited from class javax.faces.component.UIForm
createUniqueId, getContainerClientId, getFamily, isPrependId, isSubmitted, processDecodes, setPrependId, setSubmitted, visitTree
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
 
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

Form

public Form()
Method Detail

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIForm

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIForm

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

isIncludeViewParams

public java.lang.Boolean isIncludeViewParams()
Return whether or not the view parameters should be encoded into the form's action URL.


setIncludeViewParams

public void setIncludeViewParams(boolean includeViewParams)
Set whether or not the view parameters should be encoded into the form's action URL.

Parameters:
includeViewParams - The state of the switch for encoding view parameters