public class MassAttribute extends TagHandler
disabled, readonly
and rendered, any literal (static) attribute value will be ignored and overridden. Only if they have
already a value expression #{...} as attribute value, then it won't be overridden. This is a technical
limitation specifically for boolean attributes as they don't default to null.
For example, the following setup
<o:massAttribute name="disabled" value="true">
<h:inputText id="input1" />
<h:inputText id="input2" disabled="true" />
<h:inputText id="input3" disabled="false" />
<h:inputText id="input4" disabled="#{true}" />
<h:inputText id="input5" disabled="#{false}" />
</o:massAttribute>
will set the disabled="true" attribute in input1, input2 and
input3 as those are the only components without a value expression on the boolean attribute.
As another general example without booleans, the following setup
<o:massAttribute name="styleClass" value="#{component.valid ? '' : 'error'}">
<h:inputText id="input1" />
<h:inputText id="input2" styleClass="some" />
<h:inputText id="input3" styleClass="#{'some'}" />
<h:inputText id="input4" styleClass="#{null}" />
</o:massAttribute>
will only set the styleClass="#{component.valid ? '' : 'error'}" attribute in input1 as
that's the only component on which the attribute is absent.
Do note that the specified EL expression will actually be evaluated on a per-component basis.
To target a specific component (super)class, use the target attribute. The example below skips labels
(as that would otherwise fail in the example below because they don't have the valid property):
<o:massAttribute name="styleClass" value="#{component.valid ? '' : 'error'}" target="javax.faces.component.UIInput">
<h:outputLabel for="input1" />
<h:inputText id="input1" />
<h:outputLabel for="input2" />
<h:inputText id="input2" />
<h:outputLabel for="input3" />
<h:inputText id="input3" />
</o:massAttribute>
nextHandler, tag, tagId| Constructor and Description |
|---|
MassAttribute(TagConfig config)
The tag constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(FaceletContext context,
UIComponent parent) |
getAttribute, getRequiredAttribute, toStringpublic MassAttribute(TagConfig config)
config - The tag config.public void apply(FaceletContext context, UIComponent parent) throws IOException
IOException