You need to sign in to do that
Don't have an account?

Loop in a template + rerender -> repeat or dataTable tag disappears
Hi,
<apex:page showHeader="false" controller="testController2">
<apex:repeat value="{!listTest}" var="te">
<apex:insert name="body" />
</apex:repeat>
</apex:page>
public with sharing class testController2 { public List<String> listTest{ get; set; } public testController2 (){ listTest= new List<String>(); listTest.add('1'); }}
<apex:page showHeader="false" controller="testController"> <apex:composition template="CSTemplate"> <apex:define name="body"> <apex:form > <apex:commandButton value="test" action="{!changeValue}" rerender="dataBlock" status="status"/> <apex:outputPanel layout="block" id="dataBlock" styleClass="block"> <h2>Test</h2> <apex:actionStatus id="status" StyleClass="status" startText="working..."/> test: {!myValue} <apex:dataTable value="{!myValue}" var="data"> <apex:column > {!data} - </apex:column> </apex:dataTable> </apex:outputPanel> </apex:form> </apex:define> </apex:composition></apex:page>
public with sharing class testController { public testController (){ myValue = new List<String>(); myValue.add('1'); } public PageReference changeValue() { myValue.add('2'); return null; } public List<String> myValue { get; set; }}