Visual Force

Visual Force is a framework that allows developers to build sophisticated, custom user interfaces that can be hosted natively on the Force.com platform. The Visual Force framework includes a tag-based markup language, similar to HTML.

In the Visual Force markup language, each Visual Force tag corresponds to a coarse or fine-grained user interface component, such as a section of a page, a related list, or a field. The behavior of Visual Force components can either be controlled by the same logic that is used in standard Salesforce pages, or developers can associate their own logic with a controller class written in Apex.

  • In VisualForce page we can write the HTML, CSS, and JavaScript etc…
  • Each visual force is page that contains the tags/components and controllers.
  • Each tag contains attributes and attributes defines the properties of the tag.
    • By default each tag has two attributes.
      • ID: – Id is used to bind the two components together.
      • Rerendered: –    Used to show/hide the component.
    • Controllers: –
      • Standard Controller: –
      • Custom Controller/Controller
      • Extension Controller

Where we can use visualforce pages?

  1. Visualforce pages can be used to
  2. Override standard buttons, such as New button for accounts, save button for contacts….etc..
  3. To override custom tabs, to create vf tabs
  4. Embed components in detail page layout.
  5. Create dashboard components on custom help pages
  6. Customize, extend on integrating the sideboards in the service cloud console(custom console components)

Standard Controller

StandardController objects reference the pre-built Visual Force controllers provided by salesforce.com. The only time it is necessary to refer to a StandardController object is when defining an extension for a standard controller. StandardController is the data type of the single argument in the extension class constructor.

  • Standard Controller is used for customization of both standard and custom objects.

Controller

The Controller is an apex class which is used to implement all the logic of VisualForce page without leveraging the standard functionality.

Extension Controller

Extension is an apex class used to extend or add the functionality to standard or custom controllers.