Visualforce-2.内置组件(components)


1.Visualforce内置组件(built-in components)

Visualforce 拥有近 150 个内置组件,可提供各种用户界面元素和行为。

Visualforce 标准组件( Standard Component Reference )引用中列出了这些组件,并记录了它们的属性,包括如何使用组件的示例代码。

示例代码:


    

Hello World

※sidebar 和 showHeader 属性在 Lightning Experience 中无效,并且无法抑制 Lightning Experience 标头。虽然 showHeader 默认值是 true,但是它对 Lightning Experience 无效。

Note that both the sidebar and showHeader attribute have no effect in Lightning Experience, and that there’s no way to suppress the Lightning Experience header. Although the default value of showHeader is true, it has no effect in Lightning Experience.


页面包含一些 Salesforce 样式表,可让您匹配 Salesforce 选择的字体、大小等。要抑制 Salesforce 的所有输出,同样需要添加 standardStylesheets="false" 来删除样式。
The page still includes some Salesforce style sheets, which let you match Salesforce choices for fonts, size, and so on. To suppress all Salesforce output, add standardStylesheets="false" to remove the styles as well.

2.迭代组件

  • Use the apex:outputLink component to link to the respective record detail page
  •  Record detail pages can be reached by placing a record ID at the root of the URL (e.g. )

示例代码:

"Account" recordSetVar="accounts">
    
        "{! accounts}" var="a">
            
  • "{! URLFOR($Action.Account.View,a.Id)}"> {!a.name}

预览结果:

 点击任意link,显示该Account的详细页面

  •  是一种结构化的用户界面元素,用于对页面上的相关项目进行分组
  •  是向页面添加结构和层级的另一个组件。显示时,用户可以折叠  元素以隐藏除节标题以外的所有元素。需要嵌套在  标签内,否则无法使用
  • :具体示例参照:
  • :具体示例参照:
  • :具体示例参照:
  • :具体示例参照:
  •  :具体示例参照:
  • :具体示例参照:  
  • :具体示例参照:  
  • :具体示例参照:
  • :具体示例参照:
  • :具体示例参照:2.迭代组件
  • :具体示例参照:
  • :具体示例参照:
  •  :具体示例参照:
  •  :具体示例参照:
  •  :具体示例参照:
  • :具体示例参照:
  • :具体示例参照:
  • :具体示例参照:

Resources

  • Create Visualforce Pages
  • Developer Console Functionality
  • Using the Editor for Visualforce
  • Tools for Visualforce Development
  • Standard Component Reference
  • The Salesforce Extensions for Visual Studio Code
  • Lightning Platform Tools and Toolkits
  • Developing Visualforce With Your Browser