function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
src0010src0010 

Difference between apex:pageBlock and apex:repeat?

Just curious (being new to VisualForce dev), but can anyone explain to me the difference between:

apex:pageBlock
and

 

 

apex:repeat

 

Both seem to iterate over data in the same method?  Thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
Chris987654321Chris987654321

pageBlock doesn't iterate over data. It is used to make a new section on the page where you can put a title. Take a look at tihs:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_component_library.htm

 

There is a PageBlockTable which iterates over data to create rows in a table. You may be confusing it with that?

 

apex:repeat lets you repeat any block of html or visualforce code. PlageBlockTable is just used to make tables where repeat can be used for just about anything you want to repeat.

All Answers

Chris987654321Chris987654321

pageBlock doesn't iterate over data. It is used to make a new section on the page where you can put a title. Take a look at tihs:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_component_library.htm

 

There is a PageBlockTable which iterates over data to create rows in a table. You may be confusing it with that?

 

apex:repeat lets you repeat any block of html or visualforce code. PlageBlockTable is just used to make tables where repeat can be used for just about anything you want to repeat.

This was selected as the best answer
src0010src0010

 


Chris987654321 wrote:

pageBlock doesn't iterate over data. It is used to make a new section on the page where you can put a title. Take a look at tihs:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_component_library.htm

 

There is a PageBlockTable which iterates over data to create rows in a table. You may be confusing it with that?

 

apex:repeat lets you repeat any block of html or visualforce code. PlageBlockTable is just used to make tables where repeat can be used for just about anything you want to repeat.


 

Yes, Sorry I was confusing 'pageBlock' and 'pageBlockTable'.  Thanks for the explanation and link...makes sense!