34.8k views
2 votes
What is Difference in render, rerender and renderas attributes of Visualforce.

1 Answer

2 votes

Final answer:

The render attribute controls the visibility of a Visualforce component, rerender specifies which parts of the page to refresh on an Ajax call, and renderAs defines the output format of a Visualforce page.

Step-by-step explanation:

The render, rerender, and renderAs attributes in Visualforce serve different purposes. The render attribute is used to conditionally display a Visualforce component on a page. It expects a boolean value which, if true, displays the component, and if false, does not.

The rerender attribute is used in conjunction with Ajax calls. It specifies which areas of the page should be rerendered or refreshed when the action completes. Use the ID of the component(s) you want to refresh.

The renderAs attribute, on the other hand, dictates the format that the Visualforce page should be displayed or outputted as. For example, using 'pdf' would output the page as a PDF file. Other formats include Excel, Word, and so on, depending on what Visualforce supports.

User John Cleary
by
8.5k points