Top VisualForce Interview Questions (2021) | CodeUsingJava
















Most frequently Asked VisualForce Interview Questions


  1. What is VisualForce?
  2. How can we create a Visualforce Page?
  3. Explain the concept of the MVC paradigm in VisualForce?
  4. What is the meaning of <apex:page> tag in VisualForce?
  5. How are VisualForce pages constructed?
  6. How to exit an apex function in VisualForce?
  7. How to format a date in VisualForce?
  8. How do we print the Current Date in VisualForce?
  9. What is Standard List Controller?
  10. What is Custom Controller?
  11. What are the three types of Bindings used in Visualforce?
  12. What is Ajax typically used for in Visualforce?

What is VisualForce?

Visualforce is marked language used for developing customized iser interface on Salesforce, It consists of 2 primary elements that is VisualForce markup and VisualForce controller.
VisualForce includes tag based language such as HTML, it is comprised of finely grained users component such as page sections, controllers, or fields etc.

How can we create a Visualforce Page?

File -> New -> Visualforce page.

Visualforce

Click Save.

Visualforce


Explain the concept of the MVC paradigm in VisualForce?

VisualForce pages is displayed to a client browser, as it is based on traditional MVC paradigm where Model, View, and controller are defined as the three separate layers.

Visualforce


What is the meaning of <apex:page> tag in VisualForce?

<apex:page> is a markup tag that helps in representing single VisualForce page and every page which will start and end with this tag only.

<apex:page>

//Body Content

</apex:page>



How are VisualForce pages constructed?

VisualForce Pages are contructed by using HTML components, controllers and style elements on the platform, it can be integrated almost any standard web technology, JavaScript database for developing feature rich animated user interface.
The pages are constructed on the server and based on logic and they interact with the database by invoking various web service calls before the output is returned to the browser or client.

How to exit an apex function in VisualForce?


public void doNothing() {
     return;
}



How to format a date in VisualForce?


<apex:page standardController="Contact">
  <apex:pageBlock title="Test">
      

{!contact.Birthdate}

</apex:pageBlock> <apex:detail relatedList="false" /> </apex:page>


How do we print the Current Date in VisualForce?

We can create a property:
public Date Today { get { return Date.today(); }}

We can try using:
<apex:outputText value="{0,date}">
    <apex:param value="{!Today}" />
</apex:outputText>


What is Standard List Controller?

Standard List Controller helps us by allowing displaying a list of records in a visualforce page, it also provides additional pagination actions compared to the standard controller.

What is Custom Controller?

Custom Controller is used in implementing customized logic to visulaforce pages, it can create new functionality by using custom controllers.

What are the three types of Bindings used in Visualforce?

There are 3 types of Bindings in VisualForce:
  • Data Bindings - helps in referring to data set in the controller.
  • Action Bindings - helps in referring to action methods in the controller.
  • Components Bindings - helps in referring to other visualforce components.

What is Ajax typically used for in Visualforce?

Ajax is used for exchanging data between server and client without reloading the complete web page, visualforce has inbuilt support for Ajax.It is used for partial page updates in VisualForce.Ajax toolkit is used for giving access to the force.com Web Services API.