@Override
    public Object saveState(FacesContext context) {
        // See MyFaces UIRepeat
        ComponentUtils.ViewPoolingResetMode viewPoolingResetMode = ComponentUtils.isViewPooling(context);
        if (viewPoolingResetMode == ComponentUtils.ViewPoolingResetMode.SOFT) {
            _dataModelMap.clear();
            _isValidChilds = true;
        }
        else if (viewPoolingResetMode == ComponentUtils.ViewPoolingResetMode.HARD) {
            _dataModelMap.clear();
            _isValidChilds = true;
            _rowStates.clear();
        }

        _origValue = null;
        _origVarStatus = null;

        return super.saveState(context);
    }
Calculates the count value for the given index.

@param index

@return
primefaces/src/main/java/org/primefaces/component/api/UITabPanel.java