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

  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-020: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. nginx图片过滤处理模块http_image_filter_module安装配置

    http_image_filter_module是nginx提供的集成图片处理模块,支持nginx-0.7.54以后的版本,在网站访问量不是很高磁盘有限不想生成多余的图片文件的前提下可,就可以用它实时 ...

  2. STL标准库中的容器

    容器:顾名思义,我的理解就是把同一种数据类型括起来,作为一捆.如vector<int> ,vector就是个容器,里面全是一个个的int型数据. 容器包括三大块: 顺序型容器: (1)ve ...

  3. MySQL root密码重置问题

    1:进入cmd,停止mysql服务:Net stop mysql (进入服务---->MySql----->停止) 到mysql的安装路径启动mysql,在bin目录下使用mysqld-n ...

  4. opencv +数字识别

    现在很多场景需要使用的数字识别,比如银行卡识别,以及车牌识别等,在AI领域有很多图像识别算法,大多是居于opencv 或者谷歌开源的tesseract 识别. 由于公司业务需要,需要开发一个客户端程序 ...

  5. React项目实战:react-redux-router基本原理

    React相关 React 是一个采用声明式,高效而且灵活的用来构建用户界面的框架. JSX 本质上来讲,JSX 只是为React.createElement(component, props, .. ...

  6. css中grid属性的使用

    grid布局 加在父元素上的属性 grid-template-columns/grid-template-rows 定义元素的行或列的宽高 如果父元素被等分成了9等分,则,不管有多少个子元素,都显示9 ...

  7. 用 git 钩子,检测代码规范性(eslint、standard)

    最终实现效果说明:用 git commit 提交代码之前,利用 pre-commit git 钩子,实现代码规范检测(eslint.standard 规范),符合规范之后才可以提交到 git 仓库.这 ...

  8. 前端每日实战:34# 视频演示如何用纯 CSS 创作在文本前后穿梭的边框

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/qYepNv 可交互视频教程 此视频 ...

  9. volatile关键字的理解

    volatile是java语言提供的一种稍弱的同步机制,它的作用是能够保证被volatile修饰的变量,每个线程在获取它的值时都能获取到最新的值. 要理解这个原理首先要知道java内存模型:每个线程都 ...

  10. 微信WXSS样式文件

    目录 WXSS官方文档 1. WXSS 1.1. 尺寸单位 1.2. 样式导入 1.3. 内联样式 1.4. 选择器 1.5. 全局样式与局部样式 WXSS官方文档 https://developer ...