[SalesForce] How to display FieldSet label and its value in PageBlockTable

I am having a Custom Object (Say MyCustomObj).It has fields A,B,C,D,E. I have created a Fieldset and added A,B,C fields for MyCustomObj.

By using Dynamic SOQL I got the values of all fields including fieldset and stored it in a list. That means this list has all values of A,B,C fields of MyCustomObj.

Now I want to populate those values in a Repeater in a VF Page.

How I will display?

Any help would be appreciated.

Best Answer

There are several examples if you google "Fieldsets in Visualforce".

Here's a nice tutorial from our own SSE guru Bob Buzzard:

http://bobbuzzard.blogspot.com/2011/02/visualforce-field-sets.html

 <apex:repeat value="{!$ObjectType.Account.FieldSets.General}" 
                    var="field">
              <apex:inputField value="{!Account[field]}" />
           </apex:repeat>