Dev401-024:Visualforce Pages: Visualforce Componets (Tags) Library Part III
Static Resources
1.Static resources are a new kind of Salesforce storage,designed for use with Visualforce.
2.Static resources are items required by your Visualforce pages,such as archives,images,stylesheets,javaScript,etc.
- These resources can be referenced using the $Resource global variable.
- They can be a collection of related files into a directory hierarchy (.zip,.jar).
- This is the recommended method over uploading these files to the Document tab,as these resources can be cached for better performance.
3.Upload files is Setup|Develop|Static Resources.
- There is a 5MB limi per file and a 250MB overall limit for static resources.

Static Resources Components
1.The following tags can all be used ti include other HTML-renderable technologies into your page.
- <apex:flash>
- <apex:image>
- <apex:stylesheet>
2.THese can be stored in the static Resources object or elsewhere on the internet.

Apex:flash
A Flash movie, rendered with the HTML object and embed tags.
<apex:page sidebar="false" showheader="false">
     <apex:flash src="http://www.adobe.com/devnet/flash/samples/drawing_1/1_coordinates.swf" 
     height="300" width="100%" />
</apex:page>

Apex:stylesheet
1.A link to a stylesheet that can be used to style components on the Visualforce page. When specified, this component injects the stylesheet reference into the head element of the generated HTML page.
2.Example
<apex:stylesheet value="/resources/htdocs/css/basic.css"/>

Apex:variable
1.A local variable that can be used as a replacement for a specified expression within the body of the component. Use <apex:variable> to reduce repetitive and verbose expressions within a page.
2.Note:<apex:variable> does not support reassignment inside of an iteration component, such as <apex:dataTable> or <apex:repeat>. The result of doing so, e.g., incrementing the <apex:variable> as a counter, is unsupported and undefined.

Apex:facet
1.A placeholder for content that is rendered in a specific part of the parent component, such as the header or footer of an <apex:dataTable>.
2.An <apex:facet> component can only exist in the body of a parent component if the parent supports facets. The name of the facet component must match one of the pre-defined facet names on the parent component. This name determines where the content of the facet component is rendered. Consequently, the order in which a facet component is defined within the body of a parent component does not affect the appearance of the parent component.
3.See <apex:dataTable> for an example of facets.

Apex:param
1.A parameter for the parent component. The <apex:param> component can only be a child of the following components:
- <apex:actionFunction>
- <apex:actionSupport>
- <apex:commandLink>
- <apex:outputLink>
- <apex:outputText>
- <flow:interview>
2.Within <apex:outputText>, there is support for the <apex:param> tag to match the syntax of the MessageFormat class in Java. See the MessageFormat class JavaDocs for more information.

Visualforce Components & JavaScript Events
1.Many Visualforce tags relate to different UI components.
2.These often have attributes quivalent to Javascript events to handle user actions to those components.

Apex:component

A custom Visualforce component. All custom component definitions must be wrapped inside a single <apex:component> tag.
 
Apex:attribute
A definition of an attribute on a custom component. The attribute tag can only be a child of a component tag.

Note that you cannot define attributes with names like id or rendered. These attributes are automatically created for all custom component definitions.

Apex:componentBody
1.This tag allows a custom component author to define a location where a user can insert content into the custom component. This is especially useful for generating custom iteration components. This component is valid only within an <apex:component> tag, and only a single definition per custom component is allowed.
2.Simple Example
<!-- Page: --> 
<apex:page>
    <apex:outputText value="(page) This is before the custom component"/><br/>
    <c:bodyExample>
        <apex:outputText value="(page) This is between the custom component" /> <br/>
    </c:bodyExample>
    <apex:outputText value="(page) This is after the custom component"/><br/>
</apex:page>

<!-- Component: bodyExample -->
<apex:component>
    <apex:outputText value="First custom component output" /> <br/>
    <apex:componentBody />
    <apex:outputText value="Second custom component output" /><br/>
</apex:component>

Exercise 3-6: Creating a Custom Component
1.Goal(s):
- Create a custom component for the slider widget used earlier.
2.Scenario:
- Universal Containers has grown to like the slider widget and wants to use it else where in other pages. However, to make things easier, they want it to be component.
3.Tasks:
- Be sure that the slider flash file is in your static resources.
- Complete the slider component.
- Add the pre-existing Visualforce page tp your org.
- Overrite the Review Edit button.
- Test the page.

Module Review
1.How many controllers can a page have? Where is the controller for a page assigned?
One.

2.There are a series of layout components that all help recreate the traditional Salesforce page layout style very easily. What name do they share?
pageBlockTable,pageBlcokSection,block

3.What are the names of the coarse metadata tags?
detail,listview
4.which tags should be used to automatically bring in the Salesforce label and default widget for a field?
inputField
5.What are static resources?
styleSheet, JS,CSS

Building Applications with Force.com and VisualForce (DEV401) (二三):Visualforce Componets (Tags) Library Part III的更多相关文章

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

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

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

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

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

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

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

  8. Building Applications with Force.com and VisualForce (DEV401) (三):Application Essential:Building Your Data Model

    Dev 401-003:Application Essential:Building Your Data Model Object Relationships1.Link two objects- P ...

  9. Building Applications with Force.com and VisualForce (DEV401) (二) : Application Essentials:Designing Application on the Force.com Platform

    Dev 401-002:Application Essentials:Designing Application on the Force.com Platform Course Objectives ...

随机推荐

  1. 脚本化处理linux云服务器第二硬盘初始化

    #!/usr/bin/bash # 可以带参数 method=$ size=$ mydir=$ [ $#== ]&&{ echo -e "Missing parameter! ...

  2. 后渗透之meterpreter使用攻略

    Metasploit中的Meterpreter模块在后渗透阶段具有强大的攻击力,本文主要整理了meterpreter的常用命令.脚本及使用方式.包含信息收集.提权.注册表操作.令牌操纵.哈希利用.后门 ...

  3. AOP面试知识整理,^_^-包括spring Aop

    讲到java企业级开发框架,就不可避免的讲到 IOC,AOP,MCV 今天面试时被问到AOP,讲的很乱,这里整理笔记,包括AOP,spring-AOP的部分知识,错误的地方请小伙伴指出来. 谈谈你对A ...

  4. 【Amaple教程】5. 插件

    Amaple 拥有非常强大插件功能,这也是它的突出功能之一,Amaple插件一般表现为功能块(函数)或功能块(包含一系列函数和属性的Object对象),它除了支持Amaple规范定义的插件外,还支持所 ...

  5. 简单的节流函数throttle

    在实际项目中,总会遇到一些函数频繁调用的情况,比如window.resize,mouseover,上传进度类似的触发频率比较高的函数,造成很大的性能损耗,这里可以使用节流函数来进行性能优化,主要是限制 ...

  6. Vue的模板内换行问题

    在用vue的模板{{}}进行渲染文本时候,字符串换行不起作用,后使用ES6的模板字符串进行换行仍然不起作用,解决方法: <div>{{str}}</div> 可换为用v-htm ...

  7. 脚本写一行echo也能写出bug ? glob了解一下

    背景 最近处理一个 bug 很有意思,有客户反馈某个配置文件解析失败了,出错的那行的内容就只有一个字母 a. 最开始以为是谁改动了处理的脚本,但要到了问题代码中的脚本,比较发现跟库上是一样的. 又经过 ...

  8. 深入探索 TCP TIME-WAIT

    1​ TIME-WAIT 状态 主动关闭连接的一方,在四次挥手最后一次发送 ACK 后,进入 TIME_WAIT 状态.在这个状态里,主动关闭连接一方等待 2MSL(Maximum Segment L ...

  9. 取url地址参数

    let url = 'https://i-beta.cnblogs.com/posts/edit?param1=123&param2=second'let arr = url.split('& ...

  10. c strncpy 容易出错的地方

    使用strncpy的是注意两点,目的是数组和目的是指针 .目的是数组: ] = "abcde"; // ] = "; strncpy(dest,src,N); dest[ ...