RichFaces 4.0 Planning: JSF 2.1 Features

Version 1
    IterationStateHolder interface for UIData-based components

     

    Current UIData implementation saves only a fey EditableValueHolder attributes between iterations. But some other JSF components have to save some row-related values too. In the standard components set they are UIForm whose attribute "submitted" is row-depended and UIData itself. In the third-party components are Facelets UIRepeat, Tomahawk data tables, some RichFaces components etc. Currently, most of them look for a parent "UIDate" instance to adjust per-row behavior. My proposal is delegate per-iteration state procedures to the IterationStateHolder interface, as StateHolder does for a per request state:

     

    public interface IterationStateHolder {
    
       public Object saveIterationState(FacesContext context); 
    
       public void restoreIterationState(FacesContext context, Object state);
    } 
    


    So, all iteration components like UIData, UIRepeat and other should save and restore object from IterationState holder instead of the particular EditableValueHolder attributes (I guess EditableValueHolder should be saved and restored too for the backward compatibility).

    Unfortunately, JSF 2.0 appends UIForm state saving only. UIRepeat still be a separate component with different behavior.