Name

<f:attribute>

Synopsis

This action sets a generic attribute for the component represented by the closest JSF component parent action element.

Syntax

<f:attribute name="name" value="value" />

Attributes

Attribute name

Java type

EL expression type

Description

name
String

Any

The attribute name.

value
Object

Any

The attribute value.

Example

<h:form>
  <h:inputText id="from" value="#{filter.from}" />
  <h:inputText value="#{filter.to}">
    <f:validator validatorId="com.mycompany.laterThanValidator" />
    <f:attribute name="compareToComp" value="from" />
  </h:inputText>
</h:form>

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.