Just call component.setId(component.getId()) to reset all client ids and ensure they will be calculated for the current row, but do not waste
time dealing with row state code.

@param parent
@param iterateFacets
@param restoreChildFacets
429745
private void restoreDescendantComponentWithoutRestoreState(UIComponent parent, boolean iterateFacets,
                                                               boolean restoreChildFacets) {
        if (iterateFacets && parent.getFacetCount() > 0) {
            Iterator<UIComponent> childIterator = parent.getFacets().values().iterator();

            while (childIterator.hasNext()) {
                UIComponent component = childIterator.next();

                // reset the client id (see spec 3.1.6)
                component.setId(component.getId());
                if (!component.isTransient()) {
                    restoreDescendantComponentWithoutRestoreState(component, restoreChildFacets, true);
                }
            }
        }

        if (parent.getChildCount() > 0) {
            for (int i = 0; i < parent.getChildCount(); i++) {
                UIComponent component = parent.getChildren().get(i);

                // reset the client id (see spec 3.1.6)
                component.setId(component.getId());
                if (!component.isTransient()) {
                    restoreDescendantComponentWithoutRestoreState(component, restoreChildFacets, true);
                }
            }
        }
    }
909411
public void setParentLinks(java.util.Collection<ObjectIdentifierAndLinkNameTuple> parentLinks) {
        if (parentLinks == null) {
            this.parentLinks = null;
            return;
        }

        this.parentLinks = new java.util.ArrayList<ObjectIdentifierAndLinkNameTuple>(parentLinks);
    }
880274
public static void repairParentRelationships(Collection<ActivityInstanceImpl> values, String processInstanceId) {
    for (ActivityInstanceImpl activityInstance : values) {
      // if the determined activity instance id and the parent activity instance are equal,
      // just put the activity instance under the process instance
      if (valuesEqual(activityInstance.getId(), activityInstance.getParentActivityInstanceId())) {
        activityInstance.setParentActivityInstanceId(processInstanceId);
      }
    }
  }
439519
public void activate(String clientID) {
        for (Subscription s : m_subscriptions) {
            if (s.clientId.equals(clientID)) {
                s.setActive(true);
            }
        }

        //go deep
        for (TreeNode child : m_children) {
            child.activate(clientID);
        }

    }
1023143
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
            ELException
    {
        if (parent == null)
        {
            throw new TagException(this.tag, "Parent UIComponent was null");
        }
        parent.getAttributes().put(KEY, this.name.getValue(ctx));
        try
        {
            this.nextHandler.apply(ctx, parent);
        }
        finally
        {
            parent.getAttributes().remove(KEY);
        }
    }
153931
private void saveInitialChildState(FacesContext facesContext, UIComponent component) {
        if (component instanceof EditableValueHolder && !component.isTransient()) {
            String clientId = component.getClientId(facesContext);
            SavedState state = new SavedState();
            initialChildState.put(clientId, state);
            state.populate((EditableValueHolder) component);
        }

        Iterator<UIComponent> iterator = component.getFacetsAndChildren();
        while (iterator.hasNext()) {
            saveChildState(facesContext, iterator.next());
        }
    }
843514
private void recursivelyRemoveNodesFromPage(final DOMNode parent, final SecurityContext securityContext) throws FrameworkException {

		// Remove node from page
		final PropertyMap changedProperties = new PropertyMap();

		changedProperties.put(StructrApp.key(DOMNode.class, "syncedNodes"), Collections.EMPTY_LIST);
		changedProperties.put(StructrApp.key(DOMNode.class, "pageId"),      null);

		parent.setProperties(securityContext, changedProperties);

		// recurse
		for (final DOMNode child : parent.getChildren()) {

			recursivelyRemoveNodesFromPage(child, securityContext);
		}
	}
77635
function refreshChildComponents(components) {
    if (components != null) {
        for (var i = 0; i < components.length; i += 2) {
            componentRefresh(components[i], components[i + 1]);
        }
    }
}
387049
@Override
    public void setClientId(final String clientId) {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setClientId", clientId);
        }
        _clientId = clientId;
    }
1038398
protected void clearTreeLevel(CmsUUID parentId) {

        // create a new list to avoid concurrent modifications
        Collection<?> children = m_treeContainer.getChildren(parentId);
        // may be null when monkey clicking
        if (children != null) {
            List<Object> childIds = new ArrayList<Object>(m_treeContainer.getChildren(parentId));
            for (Object childId : childIds) {
                m_treeContainer.removeItemRecursively(childId);
            }
        }
    }
1093973
private void internalSetParent(CommandRegistry parentRegistry) {
        
        if (!ObjectUtils.nullSafeEquals(this.parent, parentRegistry)) {
            
            if (this.parent != null) {
                this.parent.removeCommandRegistryListener(this);
            }
            
            this.parent = parentRegistry;
            
            if (this.parent != null) {
                this.parent.addCommandRegistryListener(this);
            }
            
        }
        
    }
939391
@Override
    public void restoreState(final FacesContext context, final Object state) {
        if (state == null) {
            return;
        }

        final Object values[] = (Object[]) state;
        super.restoreState(context, values[0]);
        final Object restoredSubmittedValues = values[1];
        final Object restoredLocalValues = values[2];
        final Object restoredInvalidUpdates = values[3];
        final Object restoredColMappings = values[4];
        final Object restoredSortedList = values[5];
        final Object restoredRowMap = values[6];
        final Object restoredRowNumbers = values[7];

        if (restoredSubmittedValues == null) {
            submittedValues.clear();
        }
        else {
            submittedValues = (Map<SheetRowColIndex, String>) restoredSubmittedValues;
        }

        if (restoredLocalValues == null) {
            localValues.clear();
        }
        else {
            localValues = (Map<SheetRowColIndex, Object>) restoredLocalValues;
        }

        if (restoredInvalidUpdates == null) {
            getInvalidUpdates().clear();
        }
        else {
            invalidUpdates = (List<SheetInvalidUpdate>) restoredInvalidUpdates;
        }

        if (restoredColMappings == null) {
            columnMapping = null;
        }
        else {
            columnMapping = (Map<Integer, Integer>) restoredColMappings;
        }

        if (restoredSortedList == null) {
            getFilteredValue().clear();
        }
        else {
            setFilteredValue((List<Object>) restoredSortedList);
        }

        if (restoredRowMap == null) {
            rowMap = null;
        }
        else {
            rowMap = (Map<String, Object>) restoredRowMap;
        }

        if (restoredRowNumbers == null) {
            rowNumbers = null;
        }
        else {
            rowNumbers = (Map<String, Integer>) restoredRowNumbers;
        }
    }
942738
@Override
  public void setChildren(Tree[] children) {
    if (children == null) {
      System.err.println("Warning -- you tried to set the children of a SimpleTree to null.\nYou should be really using a zero-length array instead.");
      daughterTrees = EMPTY_TREE_ARRAY;
    } else {
      daughterTrees = children;
    }
  }
1172310
public List<UIComponent> resolve(UIComponent component, List<UIComponent> parentComponents, String currentId,
			String originalExpression, String[] parameters) {
		List<UIComponent> result = new ArrayList<UIComponent>();
		for (UIComponent parent : parentComponents) {
			UIComponent grandparent = component.getParent();
			for (int i = 0; i < grandparent.getChildCount(); i++) {
				if (grandparent.getChildren().get(i) == parent) {
						if(i == 0) //if this is the first element of this component tree level there is no previous
							throw new FacesException(ERROR_MESSAGE + originalExpression);
						//otherwise take the components before this one
						while ((--i)>=0) {
							result.add(grandparent.getChildren().get(i));
						}
						return result;
				}
			}
		}

		throw new FacesException(ERROR_MESSAGE + originalExpression);
	}
592949
public void applyChildren( Object defaultee ) {

        if ( defaultee == null ) {
            throw new TransformException( "Defaultee should never be null when " +
                    "passed to the applyChildren method." );
        }

        // This has nothing to do with this being an ArrayKey or MapKey, instead this is about
        //  this key being the parent of an Array in the output.
        if ( isArrayOutput() && defaultee instanceof List) {

            @SuppressWarnings( "unchecked" )
            List<Object> defaultList = (List<Object>) defaultee;

            // Extend the defaultee list if needed
            for ( int index = defaultList.size() - 1; index < getOutputArraySize(); index++ ) {
                defaultList.add( null );
            }
        }

        // Find and sort the children DefaultrKeys by precedence: literals, |, then *
        ArrayList<Key> sortedChildren = new ArrayList<>();
        sortedChildren.addAll( children );
        Collections.sort( sortedChildren, keyComparator );

        for ( Key childKey : sortedChildren ) {
            childKey.applyChild( defaultee );
        }
    }
571397
@SuppressWarnings("unchecked")
  public void setParent(PvmExecutionImpl parent) {
    PvmExecutionImpl currentParent = getParent();

    setParentExecution(parent);

    if (currentParent != null) {
      currentParent.getExecutions().remove(this);
    }

    if (parent != null) {
      ((List<PvmExecutionImpl>) parent.getExecutions()).add(this);
    }
  }
1023876
def remove_children(self, reset_parent=True):
        
        if reset_parent:
            for child in self.children:
                child.parent = None
        self.__children = []