Building Applications with Force.com and VisualForce(Dev401)(十九):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 attributed that have values (in quotes) to help further define them.
- Attribute values are typed to be strings, collections,ids,etc.
- For a full list of tags and attributes, check the documentation.
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.
- Component bindings:using component attribute values to reference other components' IDs.
. These other components 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 names.
- 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.Binding 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 position data into an offer template.
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-021: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. ...
随机推荐
- React Native Build Apk
1 React Native安卓项目打包APK 1.1 产生签名的key 先通过keytool生成key 1 keytool -genkey -v -keystore demo-release-key ...
- Flutter Widgets 之 BottomNavigationBar 和 BottomNavigationBarItem
注意:无特殊说明,Flutter版本及Dart版本如下: Flutter版本: 1.12.13+hotfix.5 Dart版本: 2.7.0 BottomNavigationBar 和 BottomN ...
- 基于FPGA的RGB图像转灰度图像算法实现
一.前言 最近学习牟新刚编著<基于FPGA的数字图像处理原理及应用>的第六章直方图操作,由于需要将捕获的图像转换为灰度图像,因此在之前代码的基础上加入了RGB图像转灰度图像的算法实现. 2 ...
- Web最佳实践阅读总结(2)
代码符合标准 标准的页面会保证正确的渲染 页面容易被搜索引擎搜索,提高搜索排名(SEO) 提高网站的易用性 网页更好维护和扩展(Validator,HTML Validator 属于Firefox插件 ...
- 大厂常问iOS面试题--多线程篇
1.进程与线程 进程: 1.进程是一个具有一定独立功能的程序关于某次数据集合的一次运行活动,它是操作系统分配资源的基本单元. 2.进程是指在系统中正在运行的一个应用程序,就是一段程序的执行过程,我们可 ...
- Nginx + uWSGI部署中的一些小坑
1.invalid host in upstream报错 重新启动nginx : sudo /etc/init.d/nginx restart 原因是在配置负载均衡nginx.conf配置文件时,发现 ...
- a++与++a的陷阱与盲区
故事发生在2019.7.15的3.pm,正在复习数据结构题目,写了一句如下指令(以下函数运行在win10的dev编译器下面) #include<bits/stdc++.h> using n ...
- 【猫狗数据集】谷歌colab之使用pytorch读取自己数据集(猫狗数据集)
之前在:https://www.cnblogs.com/xiximayou/p/12398285.html创建好了数据集,将它上传到谷歌colab 在colab上的目录如下: 在utils中的rdat ...
- Python 获取MySql某个表所有字段名
在使用python导出数据库中数据的时候,往往除了插入的数据以外,还有表字段等信息需要导出,查阅了资料后发现了2种方法 第一种:在mysql自带的表里查询,这个表保存了每张表的字段信息,可以用pymy ...
- vue安卓4.4.2页面打不开的坑
项目上线两三天,有保障说安卓下面页面打不开,所以查了下具体原因,系统版本过低,安卓4.4.2,然后发现本地没有babel-polyfill的包,具体解决方案如下: 1,npm 安装 npm insta ...