Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In controler i will get the data as "List < List < String>>" , how can i display it on Visual force page?

And that "List < List < String>>" is populated based on user input(Checkbox values).

If its just List then i could able to display them using datalist

List<String> alist;

then i can use this to display them

<apex:dataList value="{!alist}" var="c">{!c}

</apex:dataList>

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

If you have a list of list "List < List < String>>" you will need to do something like :

<apex:repeat value="{!alist}" var="l">
    <apex:dataList value="{!l}" var="c">
          {!c}
    </apex:dataList>
</apex:repeat>
share|improve this answer
    
I am getting this Error: Literal value is required for attribute var in <apex:dataList> for var="{!c}" –  Akash Nidhi P S Apr 23 at 5:51
1  
This should read <apex:dataList value="{!l}" var="c"> –  altius_rup Apr 23 at 5:54
    
I updated my answer. @altius_rup, Thank you –  brovasi Apr 23 at 6:03
add comment

You can show list of list by any below approach

1) first approach

    <apex:repeat value="{!ListOfList}" var="List">
     <apex:repeat value="{!list}" var="item">
      {!item}
     </apex:repeat>
    </apex:repeat>

2) Second approach
     (this approach use when we are creating many tables on layout 
    <apex:repeat  value="{!ListOfList}" var="List">
     <apex:pageblocktable value="{!list}" var="item">
      {!item}
    </apex:pageBlockTable>
     </apex:repeat>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.