org.omnifaces.component.input
Class ViewParam

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by javax.faces.component.UIViewParameter
                      extended by org.omnifaces.component.input.ViewParam
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.EditableValueHolder, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder
Direct Known Subclasses:
ComponentIdParam

public class ViewParam
extends javax.faces.component.UIViewParameter

ViewParameter is a component that extends the standard UIViewParameter and provides a stateless mode of operation.

The standard UIViewParameter implementation calls the model setter again after postback. This is not always desired when being bound to a view scoped bean and can lead to performance problems when combined with an expensive converter.

To solve this, this component by default stores the submitted value as a component property instead of in the model (and thus in the view state in case the binding is to a view scoped bean).

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

Author:
Arjan Tijms, Bauke Scholtz

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.faces.component.UIViewParameter
javax.faces.component.UIViewParameter.Reference
 
Field Summary
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIViewParameter
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID, VALIDATE_EMPTY_FIELDS_PARAM_NAME
 
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
ViewParam()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
           
 java.lang.String getSubmittedValue()
           
 boolean isRequired()
           
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void setSubmittedValue(java.lang.Object submittedValue)
           
 
Methods inherited from class javax.faces.component.UIViewParameter
decode, encodeAll, getConvertedValue, getFamily, getName, getStringValue, getStringValueFromModel, isImmediate, setName, updateModel
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, clearInitialState, compareValues, getConverterMessage, getRequiredMessage, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isEmpty, isLocalValueSet, isValid, markInitialState, processUpdates, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, initialStateMarked, 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
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

ViewParam

public ViewParam()
Method Detail

setSubmittedValue

public void setSubmittedValue(java.lang.Object submittedValue)
Specified by:
setSubmittedValue in interface javax.faces.component.EditableValueHolder
Overrides:
setSubmittedValue in class javax.faces.component.UIViewParameter

getSubmittedValue

public java.lang.String getSubmittedValue()
Specified by:
getSubmittedValue in interface javax.faces.component.EditableValueHolder
Overrides:
getSubmittedValue in class javax.faces.component.UIViewParameter

isRequired

public boolean isRequired()
Specified by:
isRequired in interface javax.faces.component.EditableValueHolder
Overrides:
isRequired in class javax.faces.component.UIInput

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIInput

processValidators

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

getAttributes

public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Overrides:
getAttributes in class javax.faces.component.UIComponentBase