Book Image

Visualforce Developer's guide

By : Chamil Madusanka
Book Image

Visualforce Developer's guide

By: Chamil Madusanka

Overview of this book

<p>Visualforce allows you to build sophisticated, custom user interfaces that can be hosted natively on the Force.com platform. Visualforce achieves this with the help of a tag-based language which is similar to HTML. This book aims to introduce you to Visualforce development tools to develop a better perspective towards UI development with Visualforce, and take your expertise in UI development to the next level.</p> <p>"Visualforce Developer's Guide" is a hands-on guide aimed towards developing a custom UI interface. As you read through the content, you will notice that this book focuses on a single real-world example. This book builds upon this example to help you understand and use Visualforce development tools in your custom UI interfaces.</p> <p>"Visualforce Developer's Guide" begins with an introduction to Visualforce to give you an understanding of the MVC model and the Visualforce architecture. Special emphasis is given to building a rich user interface by leveraging JavaScript, jQuery, CSS, and HTML with Visualforce. Through the course of the book, you will learn how to reuse the code with the help of custom components, and minimize the Visualforce and Apex code through Visualforce dynamic binding. The later sections of the book focus on building Visualforce pages for mobile devices. By the end of the book, you will learn the best practices and security tips for Apex and Visualforce development.</p>
Table of Contents (17 chapters)
Visualforce Developer's Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Static resources


Static resources have an in-built caching feature and use the content distribution network built into Salesforce. The following are the advantages of using static resources to refer to CSS files, images, and JavaScript:

  • Use a static resource to display the content of another static resource with the action attribute of the <apex:page> tag. By doing this we can redirect from a Visualforce page to a static resource. Suppose we have a PDF as a static resource (named as helpPdf) and we use that static resource in the action attribute of the <apex:page> tag as follows:

    <apex:page sidebar="false" showHeader="false" standardStylesheets="false" action="{!URLFOR($Resource.helpPdf)}">
    </apex:page>
  • The URLFOR function plays a major role here. The redirection will not work properly without the URLFOR function. This is not limited to PDF; we can use any static resource to redirect.

    <apex:page sidebar="false" showHeader="false" standardStylesheets="false" action...