Render the markup for a <link>
element that
renders the style Resource
specified by the optional
name
and library
attributes.
Decode Behavior
No action is required during decode for this renderer.
Encode Behavior
Use the algorithm Common Encode Behavior for
encodeBegin()
, encodeChildren()
and
getRendersChildren()
.
For encodeEnd()
, use the algorithm Common
Algorithm for Obtaining A Resource to Render to obtain a
reference to the Resource
to be encoded.
Output a <link>
element. Use the result from
calling resource.getRequestPath()
as the value of the
"href" attribute. Use the result from calling
resource.getContentType()
as the value of the "type"
attribute, unless the value equals text/css
and the current doctype is a HTML5 doctype..
Use the literal string "stylesheet" as the value of the "rel"
attribute, and the literal string "screen" as the value of the "media"
attribute.
The implementation of this renderer must have a @ListenerFor
annotation attached to it, at the class level, declaring PostAddToViewEvent.class
as the value of the systemEventClass
attribute. The presence of
this annotation on a renderer implies the renderer implements ComponentSystemEventListener
,
which this renderer must do. The implementation of
processEvent()
must extract the UIComponent
from the argument event pass it to UIViewRoot.addComponentResource()
, specifying
the literal string "head
" as the last argument.
The stylsheet renderer must ensure that any stylesheets are included in the <head> of the document.
Info | Value |
---|---|
Component Type | jakarta.faces.Output |
Handler Class | None |
Renderer Type | jakarta.faces.resource.Stylesheet |
Description | None |
Name | Required | Type | Description |
---|---|---|---|
converter
|
false
| jakarta.el.ValueExpression
(must evaluate to
jakarta.faces.convert.Converter
)
| Converter instance registered with this component. |
id
|
false
| jakarta.el.ValueExpression
(must evaluate to
java.lang.String
)
| The component identifier for this component. This value must be unique within the closest parent component that is a naming container. |
rendered
|
false
| jakarta.el.ValueExpression
(must evaluate to
boolean
)
| Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. |
value
|
false
| jakarta.el.ValueExpression
(must evaluate to
java.lang.Object
)
| The current value of this component. |
library
|
false
| jakarta.el.ValueExpression
(must evaluate to
java.lang.String
)
|
The libraryName for this resource. |
name
|
false
| jakarta.el.ValueExpression
(must evaluate to
java.lang.String
)
|
The resourceName for this resource. This attribute is required if the stylesheet is NOT inline. |
binding
|
false
| jakarta.el.ValueExpression
(must evaluate to
jakarta.faces.component.UIComponent
)
| The ValueExpression linking this component to a property in a backing bean |
role | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String )
|
Per the WAI-ARIA spec and its relationship to HTML5 (Section title ARIA Role Attriubute), every HTML element may have a "role" attribute whose value must be passed through unmodified on the element on which it is declared in the final rendered markup. The attribute, if specified, must have a value that is a string literal that is, or an EL Expression that evaluates to, a set of space-separated tokens representing the various WAI-ARIA roles that the element belongs to. It is the page author's responsibility to ensure that the user agent is capable of correctly interpreting the value of this attribute. |