setIndexToRemove(-1); setAddPattern(false);
List patterns = getPatterns(); if (TapestryUtils.isRewinding(cycle, this)) {  setIndexToRemove(-1); setAddPattern(false); } else { setSize(patterns.size()); }
    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {        // reset components before rewind        setIndexToRemove(-1);        setAddPattern(false);        super.renderComponent(writer, cycle);        if (!cycle.isRewinding()) {            // nothing else to do            return;        }        List patterns = getPatterns();        if (getAddPattern()) {            patterns.add(new DialPattern());        }        int indexToRemove = getIndexToRemove();        if (indexToRemove >= 0) {            patterns.remove(indexToRemove);        }    }