o:conditionalComment is an UIComponent
which renders a conditional comment. Conditional
comments are an IE specific feature which enables the developer to (out)comment blocks of HTML depending on whether
the client is using IE and if so even which version. They are often seen in combination with CSS stylesheets like so:
<!--[if lte IE 7]> <link rel="stylesheet" href="ie6-ie7.css" /> <![endif]-->
However, Facelets renders them HTML-escaped and if javax.faces.FACELETS_SKIP_COMMENTS
context param is
set to true
then it will even not be rendered at all. You would need to workaround this with an ugly
<h:outputText escape="false">
.
<h:outputText value="<!--[if lte IE 7]><link rel="stylesheet" href="ie6-ie7.css" /><![endif]-->" escape="false" />
This component is designed to solve this problem.
<o:conditionalComment if="lte IE 7"> <link rel="stylesheet" href="ie6-ie7.css" /> </o:conditionalComment>
Note that you cannot use this with <h:outputStylesheet>
as it would implicitly be relocated as
direct child of <h:head>
.
Info | Value |
---|---|
Component Type | org.omnifaces.component.output.ConditionalComment |
Handler Class | None |
Renderer Type | None |
Description | None |
Name | Required | Type | Description |
---|---|---|---|
id | false | javax.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 | javax.el.ValueExpression
(must evaluate to java.lang.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. |
binding | false | javax.el.ValueExpression
(must evaluate to javax.faces.component.UIComponent )
|
The ValueExpression linking this component to a property in a backing bean.
|
if | true | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
The if condition of the conditional comment. This is exactly the value you would use
in <!--[if ...]> , e.g. if="lte IE 7" .
|
Output generated by Vdldoc View Declaration Language Documentation Generator.