SF Visualforce Developer Cheatsheet Web PDF
SF Visualforce Developer Cheatsheet Web PDF
Cheatsheet
Overview
Visualforce is a user interface framework with automatic data bindings and API access to Salesforce. It allows developers to rapidly build sophisticated
Model-View-Controller web applications and custom user interfaces, hosted natively on the Force.com platform.
Visualforce supports auto-generated standard controllers, as well as <apex:define> Provides content for the inserts.
extensions, to minimize the amount of coding needed. Heres an
example of a Visualforce page that uses a custom controller:
<apex:page showHeader="false" controller="Hello">
<apex:form> Ajax and JavaScript
<apex:inputText value="{!theText}"/>
<apex:commandButton value="Go"> The reRender attribute on action tags such as
<apex:commandButton> lets you refresh a part of a page.
action="{!action}" reRender="dynamic"/>
The following tags provide additional AJAX and JavaScript support:
</apex:form>
<apex:outputPanel id="dynamic">
Define JavaScript functions to be called
{!theText} <apex:actionFunction>
from JavaScript code.
</apex:outputPanel>
</apex:page>
A timer that sends an AJAX update
<apex:actionPoller>
This Visualforce page displays an input field and a button labeled Go. request at specified interval.
When clicked, it sends the value of the field to the controller, which
performs an action on it. Here, it duplicates the input. The page renders
Defines an area in a page that
the result using an AJAX update. Heres the controller:
demarcates which components
<apex:actionRegion>
public class Hello { should be processed when AJAX
public PageReference action() { requests generate.
theText = theText + theText;
return null; A component that displays the status
} <apex:actionStatus>
of an AJAX update request.
public String theText {get;set;}
}
Adds asynchronous refresh support
<apex:actionSupport>
to a component.
Visualforce Cheatsheet
An HTML input element of These components generate HTML for embedding flash, iframes
<apex:inputTextArea>
type text area. and images:
Knowledge
Custom Components You can embed Knowledge functionality on your pages:
UI component used
Create your own components that will reside in the c namespace, <knowledge:articleCaseToolbar> when an article is opened
for example <c:helloWorld/>: from the case detail page.
<knowledge:articleList> A loop on a filtered list
<apex:component> The outer tag that starts the of articles.
definition of a component.
<knowledge:article Displays a header toolbar
<apex:attribute> A definition of a typed attribute RendererToolbar> for an article.
on a custom component. <knowledge:articleTypeList> A loop on all available
article types.
<apex:componentBody> A place holder for content
<knowledge:categoryList> A loop on a subset of
injected into a component. the category hierarchy.
Visualforce Cheatsheet
Components that present your process visual workflow: The way to reference a
$Page
Visualforce page.
<flow:interview> Embeds a Flow interview in
the page. Used for accessing static
$Resource
resources.