javax.faces.component
Interface TransientStateHolder

All Known Subinterfaces:
TransientStateHelper
All Known Implementing Classes:
HtmlBody, HtmlColumn, HtmlCommandButton, HtmlCommandLink, HtmlDataTable, HtmlDoctype, HtmlForm, HtmlGraphicImage, HtmlHead, HtmlInputHidden, HtmlInputSecret, HtmlInputText, HtmlInputTextarea, HtmlMessage, HtmlMessages, HtmlOutcomeTargetButton, HtmlOutcomeTargetLink, HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, HtmlPanelGrid, HtmlPanelGroup, HtmlSelectBooleanCheckbox, HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu, HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio, UIColumn, UICommand, UIComponent, UIComponentBase, UIData, UIForm, UIGraphic, UIInput, UIMessage, UIMessages, UINamingContainer, UIOutcomeTarget, UIOutput, UIPanel, UIParameter, UISelectBoolean, UISelectItem, UISelectItems, UISelectMany, UISelectOne, UIViewParameter, UIViewRoot

public interface TransientStateHolder

This interface is implemented by classes that need to save state that is expected to be available only within the scope of the current request.

An implementor must implement both saveTransientState(javax.faces.context.FacesContext) and restoreTransientState(javax.faces.context.FacesContext, java.lang.Object) methods in this class, since these two methods have a tightly coupled contract between themselves. In other words, if there is an inheritance hierarchy, it is not permissible to have the saveTransientState(javax.faces.context.FacesContext) and restoreTransientState(javax.faces.context.FacesContext, java.lang.Object) methods reside at different levels of the hierarchy.

An example of transient state is the "submitted" property on forms.

Since:
2.1

Method Summary
 void restoreTransientState(FacesContext context, java.lang.Object state)
          

Restore the "transient state" using the object passed as state.

 java.lang.Object saveTransientState(FacesContext context)
          

Return the object containing related "transient states".

 

Method Detail

saveTransientState

java.lang.Object saveTransientState(FacesContext context)

Return the object containing related "transient states". that could be used later to restore the "transient state".

Parameters:
context -
Returns:
object containing transient values
Since:
2.1

restoreTransientState

void restoreTransientState(FacesContext context,
                           java.lang.Object state)

Restore the "transient state" using the object passed as state.

If the state argument is null clear any previous transient state if any and return.

Parameters:
context -
state - the object containing transient values
Since:
2.1


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41