Activity Forums Salesforce® Discussions Can i pass the set in apex:repeat in Salesforce?

  • Saurabh

    Member
    May 15, 2017 at 11:53 am

    Hi Suraj

    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>

    Hope it may help

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos