Building Applications with Force.com and VisualForce (DEV401) (二十):Visualforce Pages: Visualforce Componets (Tags)
Dev401-021:Visualforce Pages: Visualforce Componets (Tags)
Module Agenda
1.Tag Basics
2.Tag Bindings
Tag Basics
1.Visualforce includes a tag library similar to HTML and XML markup languages.
2.You can include text directly into the Visualforce page.
4.You can use HTML tags within a Visaulforce page, including:
- HTML comment tags.<!-- comments -->
- Formatting tags.
5.You can use JavaScript within a Visualforce page as well, but you will often find it easier to use the equivalent Visualforce tags.
.Note:You cannot use JavaScript line commenting except within <script>tags.
Tag Basics
1.Visualforce components (tags) all begin with the apex: prefix.
2.All pages must be enclosed by a set of <apex:page> tags.
3.Tags may contain arrributeds that have values (in quotes) to help further define them.
- Attributevalues are typed to be strings, collections,ids,etc.
- For a full list of tags and attributes, check the documenttation.
Tag Bindings
1.Binding are ways to relate Visualforce components with either the page controller or other page components.
2.There are primarily three types of bindings for Visualforce components:
- Data bindings:using the expression syntax to pull in data from the data set made available by the page controller.
- Action bindings:using the expression syntax to call action methods for functions coded in the page controller.
- Compinent bindings:using componentattribute values to reference other components' IDs.
. These other componentts must have set a value for the id attribute.
API Naming Syntax
1.Before discussing data binding in greater detail, it is important that you understand the API naming syntax.
2.This information is available as a separate resource and should have been completed before comming to class.
3.Tags refer to objects and fields by their API anmes.
- Custom objects and fields use the __c suffix.
- Custom objects referenced through relationships use dot notation and the __r suffix.
Expression Syntax
1.Tags use the same expression syntax as formula fields and other areas of the application.
2.Dynamic object data can be inserted using the {!objectName.PropertyName} syntax.
3.Glaobal data can be inserted with the added $ syntax, such as:
- {!$User.fieldName}
- {!$Page.otherVisualforcepage}
- {!$Component.otherVisualforceComponet}
- Note that you can also access custom labels and translations using the $label variable.
4.Local variables can be created to stand in for these expressions as they can become long and unwieldy using the <apex;variable> tag.
5.Bindingg can reference custom Apex class types as well as their inner classes using dot notation.
Action Binding
1.Data binding works because the page can access the data made available through the controller.
2.In a similar manager,actions that are available through the controller can be called using the same expression syntax. These can be:
- Standard actions,such as save and edit.
- Custom actions that provide custom functionality.
. More on this later in the discussion about controllers. Note that at his point, only actions that are the shared across all objects are exposed through standard controllers.
Component Binding via Component IDs
1.All Visualforce tags have an optional id attribute that can be used to refer to the tag component.
- This id is used ad the document model access(DOM) ID when the page is rendered.
- The tag can be referenced by the id by other tags, JavaScript, or other Web-enabled languages.
2.Salesforce recommends using unique ids within each page.
- If not unique, you may need to specify the hierarchy of ids to locate the correct component.
- The hierarchy prevents the possibility of duplicate IDs on HTML elements generated by components.
.However, raw HTML could produce dupes.
Exercise 2-1:Generating a PDF from Visualforce
1.Goal(s):
- Create a printable PDF using Visualforce.
2.Scenario:
-Universal Containers wants to create a PDF for offer letters to merge relevant candidate and postion data into an offer tempplate.
3.Tasks:
- Add the pre-existing Visualforce page to your org.
- Create the custom button.
- Add the custom button to the page layout.
- Test the button.
Building Applications with Force.com and VisualForce (DEV401) (二十):Visualforce Pages: Visualforce Componets (Tags)的更多相关文章
- Building Applications with Force.com and VisualForce(Dev401)(十八):Visualforce Pages: Introduction to Visualforce
Dev401-020:Visualforce Pages: Introduction to Visualforce Course Objectives1.Understand the benefits ...
- Building Applications with Force.com and VisualForce (DEV401) (二五):Visualforce Controller
Dev401-026:Visualforce Pages: Visualforce Controller Module Objectives1.Identify the functionality ...
- Building Applications with Force.com and VisualForce (DEV401) (二一):Visualforce Componets (Tags) Library Part 1
Dev401-022:Visualforce Pages: Visualforce Componets (Tags) Library Part 1 Module Objectives1.List ke ...
- Building Applications with Force.com and VisualForce (DEV401) (二四):JavaScript in Visualforce
Dev401-025:Visualforce Pages: JavaScript in Visualforce Module Objectives1.Describe the use of AJAX ...
- Building Applications with Force.com and VisualForce (DEV401) (二三):Visualforce Componets (Tags) Library Part III
Dev401-024:Visualforce Pages: Visualforce Componets (Tags) Library Part IIIStatic Resources1.Static ...
- Building Applications with Force.com and VisualForce (DEV401) (二二):Visualforce Componets (Tags) Library Part II
Dev401-023:Visualforce Pages: Visualforce Componets (Tags) Library Part II Apex:pageBlockTable1.A ...
- Building Applications with Force.com and VisualForce(Dev401)(十九):Visualforce Pages: Visualforce Componets (Tags)
Dev401-020:Visualforce Pages: Visualforce Componets (Tags) Module Agenda1.Tag Basics2.Tag Bindings T ...
- Building Applications with Force.com and VisualForce(Dev401)(十):Designing Applications for Multiple Users: Building Business Processes that You Want
Dev401-011: Building Business Processes that You Want Course Objectives1.Describe the capabilities o ...
- Building Applications with Force.com and VisualForce (DEV401) (四):Building Your user Interface
Dev 401-004:Application essential:Building Your user Interface: Module Agenda1.Custom Applications2. ...
随机推荐
- 基于arduino的红外传感系统
一.作品背景 在这个科技飞速发展的时代,物联网已经成为了我们身边必不可少的技术模块,我这次课程设计做的是一个基于arduino+树莓派+OneNet的红外报警系统,它主要通过识别人或者动物的运动来判断 ...
- kafka知识整理
title: kafka知识整理 date: 2019-06-18 10:59:46 categories: MQ tags: kafka --- 转载自:https://www.cnblogs.co ...
- node--静态服务器
1.同步读取文件 const data = fs.readFileSync('./model/mime.json'); // 这里是添加了可以正常链接其他格式文件的服务器 const http = ...
- 利用GitHub制作在线炫酷简历
首先我们先体验一下炫酷简历.然后决定我们要不要使用. https://jessezhao1990.github.... 如何使用本项目部署你自己的在线简历 1. 书写简历 在src文件夹里面有个con ...
- node中fs模块 - fs.open() fs.read() fs.write() fs.close()
var fs = require('fs') fs.open('./a.txt', 'a+', function(err, fd) { // 打开文件后 创建缓冲区放置数据 ), // 读取多少字节 ...
- 从0开始搭建一个阿里云java部署环境
一.购买服务器 https://www.aliyun.com/daily-act/ecs/activity_selection?spm=5176.8112568.738194.8.674c9ed53Y ...
- 结题报告--P5551洛谷--Chino的树学
题目:点此 题目描述 Chino树是一棵具有某种性质的满二叉树,具体来说,对于这棵树的每一个非叶子节点,它的左子节点(A)(A)(A)的右子节点(C)(C)(C)与它的右子节点(B)(B)(B)的左子 ...
- docker学习之路
环境 : ubuntu 16.4 下载docker 首先使用命令行下载 docker wget -qO- https://get.docker.com/ | sh 启动 下载完成之后进行一个启动,但是 ...
- HTC推出了VIVE Comos 全新 VR(虚拟现实)系列产品
据 The Verge 报道,近日,HTC 推出了 VIVE Comos 全新 VR(虚拟现实)系列产品.包括 Cosmos 精英套装.VIVE Cosmos XR 版.Cosmos Play 基础版 ...
- jupyternotebook安装
本篇阅读目录 一.Jupyter notebook环境安装 二.爬虫介绍 回到顶部 一.Jupyter notebook环境安装 1.Anaconda 以及 安装步骤 Anaconda指的是一个开源的 ...