根据VF页面的顶点代码中的顺序打印列表中的元素

时间:2019-01-21 02:09:37

标签: salesforce apex

我想循环显示列表,并根据顺序打印列表中的元素:

下面是我的VF页面代码:

            <apex:pageBlockSectionItem >
                <apex:repeat value="{!listA}" var="a">
                    {!a}
                    <apex:repeat value="{!listtodo}" var="t">
                        {!t}
                    </apex:repeat>
                </apex:repeat>
            </apex:pageBlockSectionItem>

下面是我的控制器代码:

listA = new List<String>(); // Here actually is like this ['Sentence 1','Sentence 2']
listB = new List<String>(); // here actually is like this ['I have many thing','I have a lot of thing','I always have things','Nothing','Have no thing','I do not have it']
for (Object to: tod) {
    Map<String, Object> c= (Map<String, Object>)to;
    Boolean is = (Boolean)c.get('is');
    if(is == True){
        sentence = (String)c.get('xx');
        listA.add(sentence);
        ts = (List<Object>) candidate.get('ts');
        for (Object tto: ts) {
            Map<String, Object> temp_tto = (Map<String, Object>)tto;
            todo = (String) temp_tto.get('ts');
            listB.add(todo);
            Map<String, Object> info = (Map<String, Object>) temp_tto.get('info');

我想要的是让我的VF页面根据此格式打印元素。

句子1:

我有很多东西
我有很多东西
我总是有东西

句子2:

什么都没有
没事
我没有

有没有办法这样显示我的数据?

0 个答案:

没有答案