public class setvfcontroller { public set<String> myset{get;set;} public setvfcontroller() { myset=new set<String>(); myset.add('value1'); myset.add('value2'); myset.add('value3'); myset.add('value4'); myset.add('value5'); system.debug('set'+myset); } } Hope this will help you.Mark it as best answer if you find it helpful.
see above code, it will show records on VF page.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm
Hope this works.
Thanks
Please try this code:
Vf page:
<apex:page controller="setvfcontroller" >
<apex:pageBlock>
<apex:repeat value="{!myset}" var="s" id="theRepeat">
<apex:outputText value="{!s}" id="theValue"/><br/>
</apex:repeat>
</apex:pageBlock>
</apex:page>
Controller class:
public class setvfcontroller {
public set<String> myset{get;set;}
public setvfcontroller()
{
myset=new set<String>();
myset.add('value1');
myset.add('value2');
myset.add('value3');
myset.add('value4');
myset.add('value5');
system.debug('set'+myset);
}
}
Hope this will help you.Mark it as best answer if you find it helpful.
Thanks.
Ajay Dubedi