@Override
    public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
        if (!isRepeating()) {
            return super.invokeOnComponent(context, clientId, callback);
        }
        else {
            if (context == null || clientId == null || callback == null) {
                throw new IllegalArgumentException();
            }

            final String baseClientId = getClientId(context);

            // searching for this component?
            boolean returnValue = baseClientId.equals(clientId);

            pushComponentToEL(context, this);
            try {
                if (returnValue) {
                    try {
                        callback.invokeContextCallback(context, this);
                        return true;
                    }
                    catch (Exception e) {
                        throw new FacesException(e);
                    }
                }

                // Now Look throught facets on this UIComponent
                if (getFacetCount() > 0) {
                    for (Iterator<UIComponent> it = getFacets().values().iterator(); !returnValue && it.hasNext();) {
                        returnValue = it.next().invokeOnComponent(context, clientId, callback);
                    }
                }

                if (returnValue) {
                    return returnValue;
                }

                // is the component an inner component?
                if (clientId.startsWith(baseClientId)) {
                    // Check if the clientId for the component, which we
                    // are looking for, has a rowIndex attached
                    char separator = UINamingContainer.getSeparatorChar(context);
                    String subId = clientId.substring(baseClientId.length() + 1);
                    //If the char next to baseClientId is the separator one and
                    //the subId matches the regular expression
                    if (clientId.charAt(baseClientId.length()) == separator
                            && subId.matches("[0-9]+" + separator + ".*")) {
                        String clientRow = subId.substring(0, subId.indexOf(separator));

                        // safe the current index, count aside
                        final int prevIndex = _index;
                        final int prevCount = _count;

                        try {
                            int invokeIndex = Integer.parseInt(clientRow);
                            // save the current scope values and set the right index
                            captureScopeValues();
                            if (invokeIndex != -1) {
                                // calculate count for RepeatStatus
                                _count = calculateCountForIndex(invokeIndex);
                            }
                            setIndex(invokeIndex);

                            if (!isIndexAvailable()) {
                                return false;
                            }

                            for (Iterator<UIComponent> it1 = getChildren().iterator();
                                    !returnValue && it1.hasNext();) {
                                //recursive call to find the component
                                returnValue = it1.next().invokeOnComponent(context, clientId, callback);
                            }
                        }
                        finally {
                            // restore the previous count, index and scope values
                            _count = prevCount;
                            setIndex(prevIndex);
                            restoreScopeValues();
                        }
                    }
                    else {
                        // Searching for this component's children
                        if (getChildCount() > 0) {
                            // Searching for this component's children/facets
                            for (Iterator<UIComponent> it = getChildren().iterator(); !returnValue && it.hasNext();) {
                                returnValue = it.next().invokeOnComponent(context, clientId, callback);
                            }
                        }
                    }
                }
            }
            finally {
                //all components must call popComponentFromEl after visiting is finished
                popComponentFromEL(context);
            }

            return returnValue;
        }
    }
Calculates the count value for the given index.

@param index

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