30.59. <w:stylesheet>

Stylesheet构件用来引入外部的css文件。与标准Html中的<script>不同,<w:script>的src属性允许使用“/”号指定使用相对于应用的Context Root路径的资源。

30.59.1. 构件信息

表 30.141. 构件信息

Component Typeorg.operamasks.faces.component.html.HtmlStylesheet
Component Familyjavax.faces.Output
Component Classorg.operamasks.faces.component.html.HtmlStylesheet
Tag Classorg.operamasks.faces.webapp.widget.HtmlStylesheetTag
Renderer Typeorg.operamasks.faces.component.html.HtmlStylesheet
Renderer Class(AJAX)org.operamasks.faces.render.widget.ajax.AjaxHtmlStylesheetRenderer

继承体系

+java.lang.Object

++javax.faces.component.UIComponent

+++javax.faces.component.UIComponentBase

++++javax.faces.component.UIOutput

+++++org.operamasks.faces.component.html.HtmlStylesheetBase

++++++org.operamasks.faces.component.html.HtmlStylesheet

30.59.2. 属性

表 30.142. 属性

binding 定义类 javax.faces.component.UIComponentBase
类型 javax.el.ValueExpression(javax.faces.component.UIComponent)
是否必须 延时求值
一个值表达式,用于把该组件链接到一个ManagedBean的某个属性。
id 定义类 javax.faces.component.UIComponentBase
类型 java.lang.String
是否必须 延时求值
这个组件的组件标识符。这个值在最近的命名容器类型的父组件范围内,必须是唯一的。
rendered 定义类 javax.faces.component.UIComponentBase
类型 boolean(boolean)
是否必须 延时求值
一个标志,指出该组件是否要在任何随后的form提交过程中被渲染或处理。 这个属性的缺省值是true。
src 定义类 org.operamasks.faces.component.html.HtmlStylesheet
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
目标 URL 或锚点。允许使用“/”号指定使用相对于应用的Context Root路径的资源
type 定义类 org.operamasks.faces.component.html.HtmlStylesheet
类型 javax.el.ValueExpression(java.lang.String)
是否必须 延时求值
对象的 MIME 类型。合法取值为text/css(默认)

30.59.3. 构件API

30.59.4. 示例

下面例子非常简单,在页面内引入了外部的example.css文件:

<w:stylesheet src="example.css"></w:stylesheet>