HTML and CSS Reference
In-Depth Information
private void addAttributeIfTrue(UIComponent component, String attributeName) {
if (isAttributeTrue(attributeName)) {
component.getPassThroughAttributes().put(attributeName, attributeName);
* Finds the {@code <video/>} or {@code <audio/>} element in the
* composite component.
* @return {@link UIComponent} representing the {@code <video/>} or
* {@code <audio/>} element
* @throws IOException If {@link UIComponent} could not be found.
* There is no way to recover from this exception at run-time. Ensure that
* the ID of the element corresponds to ID specified in the
* {@link #ELEMENT_ID} constant
private UIComponent findMediaElement() throws IOException {
UIComponent element = findComponent(getElementId());
if (element == null) {
throw new IOException("Media element with ID "
+ getElementId() + " could not be found");
return element;
* Utility method for retrieving the attributes of a component. This method
* first checks if the attribute is an EL Expression followed by checking if
* it is a simple value.
* @param name Name of the attribute to retrieve
* @return The value of the attribute. If the contents of the attribute is
* an EL Expression, the expression will be executed and returned. If the
* contents of the attribute is a simple value, it will be returned as is.
* If the attribute cannot be found {@code null} is returned.
private Object getAttribute(String name) {
ValueExpression ve = getValueExpression(name);
if (ve != null) {
// Attribute is a value expression
return ve.getValue(getFacesContext().getELContext());
} else if (getAttributes().containsKey(name)) {
// Attribute is a fixed value
return getAttributes().get(name);
} else {
// Attribute doesn't exist
return null;
Search WWH ::

Custom Search