protected boolean keepSaved(FacesContext context) {

        return (contextHasErrorMessages(context) || isNestedWithinIterator());

    }
<p>Return <code>true</code> if we need to keep the saved
per-child state information.  This will be the case if any of the
following are true:</p>

<ul>

<li>there are messages queued with severity ERROR or FATAL.</li>

<li>this <code>UIData</code> instance is nested inside of another
<code>UIData</code> instance</li>

</ul>

@param context {@link FacesContext} for the current request
primefaces/src/main/java/org/primefaces/component/patch/UIDataPatch.java