Activity Forums Salesforce® Discussions How to use Apex Repeat with Set Collection in Salesforce?

  • Deepak

    Member
    August 12, 2019 at 2:43 pm

    You can definitely use a Set in a repeat.

    In the Controller. The property and initializing it in the Constructor, for example's sake:

    public with sharing class TestController {
    public Set<String> aset { get; set; }

    public TestController () {
    aset = new Set<String>{'a','b','c'};
    }
    }

    The Visualforce snippet:

    <apex:repeat value="{!aset}" var="a">
    <apex:outputText value="{!a}"/><br/>
    </apex:repeat>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos