你可以使用 apex:dynamicComponent 来实现。创建和显示动态组件
到目前为止,你试过什么,有什么没用的?你的问题很差,不可能吸引更多的答案。
最简单的是有一个项目列表(不仅仅是一个计数器,一个列表),然后用它来迭代。<apex:repeat>
.
public class Stack61357421 {
public List<String> sectionTitles {get; private set;}
public Stack61357421(){
sectionTitles = new List<String>{'lorem', 'ipsum', 'dolor', 'sit', 'amet'};
}
}
<apex:page controller="Stack61357421" tabStyle="Account">
<apex:pageBlock title="Hi stack">
<apex:repeat value="{!sectionTitles}" var="title">
<apex:pageBlockSection title="{!title}">
content goes here
</apex:pageBlockSection>
</apex:repeat>
</apex:pageBlock>
</apex:page>