@Override
    public Object saveState(FacesContext context)
    {
        // -- From MyFaces UIData#saveState
        ComponentUtils.ViewPoolingResetMode viewPoolingResetMode = ComponentUtils.isViewPooling(context);
        if (viewPoolingResetMode == ComponentUtils.ViewPoolingResetMode.SOFT) {
            _rowTransientStates.clear();
            _initialDescendantFullComponentState = null;

            baseClientId = null;
            isNested = null;
            oldVar = null;
        }
        else if (viewPoolingResetMode == ComponentUtils.ViewPoolingResetMode.HARD) {
            _rowTransientStates.clear();
            _rowDeltaStates.clear();
            _initialDescendantFullComponentState = null;

            baseClientId = null;
            isNested = null;
            oldVar = null;
        }
        // -- End MyFaces UIData#saveState

        resetClientIds(this);
        
        if (initialStateMarked()) {
            Object superState = super.saveState(context);
            
            if (superState == null && _rowDeltaStates.isEmpty()) {
                return null;
            }
            else {
                Object values[] = null;
                Object attachedState = UIComponentBase.saveAttachedState(context, _rowDeltaStates);
                if (superState != null || attachedState != null) {
                    values = new Object[] { superState, attachedState };
                }
                return values; 
            }
        } else {
            Object values[] = new Object[2];
            values[0] = super.saveState(context);
            values[1] = UIComponentBase.saveAttachedState(context, _rowDeltaStates);
            return values;
        }
    }
<p class="changed_added_2_1">Override the base class method to
take special action if the method is being invoked when {@link
StateManager#IS_BUILDING_INITIAL_STATE} is true
<strong>and</strong> the <code>rowStatePreserved</code>
JavaBeans property for this instance is <code>true</code>.</p>

<p class="changed_modified_2_1">The additional action taken is to
traverse the descendents and save their state without regard to
any particular row value.</p>

@since 2.1
primefaces/src/main/java/org/primefaces/component/patch/UIDataPatch.java