Dev401-020: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)的更多相关文章

  1. 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 ...

  2. Building Applications with Force.com and VisualForce (DEV401) (二五):Visualforce Controller

    Dev401-026:Visualforce Pages: Visualforce Controller   Module Objectives1.Identify the functionality ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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. ...

随机推荐

  1. list转map,set,使用stream进行转化

    #list转map,set,使用stream进行转化 函数式编程: 场景: 从数据库中取出来的数据,经常是list集合类型,但是list转map这种场景虽然不常见,但是有时候也会遇到,最常见的还是转为 ...

  2. css布局中的各种FC(BFC、IFC、GFC、FFC)

    什么是FC?FC(Formatting Context)格式化上下文,其实指的是一个渲染区域,拥有一套渲染规则,它决定了其子元素如何定位,以及与其他元素之间的关系和相互作用. 什么是BFC? BFC( ...

  3. javascript设计模式--策略模式

    javascript策略模式总结 1.什么是策略模式? 策略模式的定义是:定义一系列的算法,把他们独立封装起来,并且可以相互替换. 例如我们需要写一段代码来计算员工的奖金.当绩效为a时,奖金为工资的5 ...

  4. JavaScript 工作原理之十三-CSS 和 JS 动画底层原理及如何优化其性能

    原文请查阅这里,本文采用知识共享署名 4.0 国际许可协议共享,BY Troland. 本系列持续更新中,Github 地址请查阅这里. 这是 JavaScript 工作原理的第十三章. 概述 正如你 ...

  5. Nginx server name配置子域名二级域名

    绑定子域名到不同目录(子站) 网站的目录结构为 /var/www/html: ├── fx └── blog└── photo html为nginx的默认网站目录. sudo vi /etc/ngin ...

  6. [LeetCode] 面试题 10.01.合并排序的数组

    题目: 这道题有多种实现的思路,这里使用双指针结合数组有序的特点进行解决 思路: m代表A初始时有效元素的个数,n代表B中元素的个数,那么n+m才是A的总长度 从A的最后一个位置开始,设为cur,分别 ...

  7. JZOJ 1775. 合并果子2 (Standard IO)

    1775. 合并果子2 (Standard IO) Time Limits: 1000 ms Memory Limits: 65536 KB Description 在一个果园里,多多已经将所有的果子 ...

  8. Tomcat8优化

    一.Tomcat8优化 Tomcat服务器在JavaEE项目中使用率非常高,所以在生产环境对Tomcat的优化也变得非常重要了. 对于Tomcat的优化,主要是从2个方面入手,一是,Tomcat自身的 ...

  9. elasticsearch 高级查询

    高级查询 子条件查询 (特定字段查询所指特定值) 复合条件查询 (以一定的逻辑组合子条件查询) 一.子条件查询 子条件查询分为 query context.filter context 1.query ...

  10. java多线程基础API

    本次内容主要讲认识Java中的多线程.线程的启动与中止.yield()和join.线程优先级和守护线程. 1.Java程序天生就是多线程的 一个Java程序从main()方法开始执行,然后按照既定的代 ...