Project Documentation

Summary

Tag name: <trh:meta>
UIComponent class: org.apache.myfaces.trinidad.component.html.HtmlMeta
Component type: org.apache.myfaces.trinidad.HtmlMeta

The meta component supports generating an html meta tag for things like reloading the page or configuring viewport characteristics like these:

  • <meta name="viewport" content="width=device-width, user-scalable=no">
  • <meta name="apple-mobile-web-app-capable" content="yes">
  • <meta http-equiv="refresh" content="2;url=./test/index.jspx">
It is also important to note that a meta HTML tag cannot have an ID so the component ID will not be seen in the browser source.

Code Example(s)

Example of three meta tags in a tr:document.

<tr:document ...>
  <f:facet name="metaContainer">
    <tr:group id="metaContainer">
      <trh:meta name="viewport" content="width=device-width, user-scalable=no"/>
      <trh:meta name="apple-mobile-web-app-capable" content="yes"/>
      <trh:meta type="httpEquiv" name="refresh" content="2;url=./test/index.jspx"/>
    </tr:group>
  </f:facet>
</tr:document>

Events

Type Phases Description
org.apache.myfaces.trinidad.event.AttributeChangeEventInvoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Attributes

Name Type Supports EL? Description
attributeChangeListenerjavax.el.MethodExpressionOnly EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
bindingorg.apache.myfaces.trinidad.component.html.HtmlMetaOnly EL an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
contentStringYes the content for the meta tag
idStringNo the identifier for the component. The identifier must follow a subset of the syntax allowed in HTML:
  • Must not be a zero-length String.
  • First character must be an ASCII letter (A-Za-z) or an underscore ('_').
  • Subsequent characters must be an ASCII letter or digit (A-Za-z0-9), an underscore ('_'), or a dash ('-').
nameStringYes the name or the http-equiv attribute for the meta tag (see the type attribute for further configuration)
renderedbooleanYes Default Value: true

whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component.
typeStringYes Valid Values: name, httpEquiv
Default Value: name

how the name attribute is used. Options are:
  • name - for "name" which is the most common use for meta tags
  • httpEquiv - for "http-equiv" which is the used in some legacy meta tags