JSF2
This is version . It is not the current version, and thus it cannot be edited.
Back to current version   Restore this version

Hier sind einige Informationen über JSF 2 gespeichert.

Composite Tags#

AJAX Status#

Die Component zeit den AJAX-Status an.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:cc="http://java.sun.com/jsf/composite"
>
	<cc:interface>
		<cc:attribute name="status" default="begin"/>
	</cc:interface>
	<cc:implementation>
		<script type="text/javascript">
			jsf.ajax.addOnEvent(function(data) {
				document.getElementById('#{cc.clientId}:status').style.visibility =
					data.status == '#{cc.attrs.status}' ? 'visible' : 'hidden';
			});
		</script>
		<rdi:html element="div" id="status" style="visibility: hidden;">
			<cc:insertChildren/>
		</rdi:html>
	</cc:implementation>
</html>

Verwendung zum Beispiel wie folgt:

<rdi:ajaxStatus>
	<h:graphicImage value="/images/wait30trans.gif"/>
</rdi:ajaxStatus>

HTML Element Tag#

Der Tag rendert ein HTML-Element mit ClientId und übergibt alle Attribute und Childrens.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:cc="http://java.sun.com/jsf/composite"
>
	<cc:interface name="test">
		<cc:attribute name="element" required="true"/>
		<cc:attribute name="rendered"/>
	</cc:interface>
	<cc:implementation>
		<c:if test="#{!rendered or rendered}">
			<h:outputText value="&lt;#{cc.attrs.element} id=&quot;#{cc.clientId}&quot;" escape="false"/>
			<c:forEach items="#{cc.attributes}" var="attribute">
				<h:outputText value=" #{attribute.key}=&quot;#{attribute.value}&quot;" escape="false"
					rendered="#{!attribute.key.startsWith('javax.faces') and
						!attribute.key.startsWith('com.sun') and
						attribute.key != 'element' and
						attribute.key != 'rendered'}"/>
			</c:forEach>
			<h:outputText value="&gt;" escape="false"/>
			<cc:insertChildren/>
			<h:outputText value="&lt;/#{cc.attrs.element}&gt;" escape="false"/>
		</c:if>
	</cc:implementation>
</html>