if (!cycle.isRewinding()) {  return; } List patterns = getPatterns(); if (getAddPattern()) { patterns.add(new DialPattern()); } int indexToRemove = getIndexToRemove(); if (indexToRemove >= 0) { patterns.remove(indexToRemove);
if (TapestryUtils.isRewinding(cycle, this) && TapestryUtils.isValid(cycle, this)) { if (getAddPattern()) { patterns.add(new DialPattern()); } int indexToRemove = getIndexToRemove(); if (indexToRemove >= 0) { patterns.remove(indexToRemove); }
    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);        }    }