Skip to content

Instantly share code, notes, and snippets.

@Rokko11
Rokko11 / child.xhtml
Created December 10, 2015 09:48
Not typesafe ui:param
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<ui:define name="columns">
<!-- At this like, the IDE does not know the type of "key". So autocompletion and refactorings of "property" will fail. -->
<h:outputText value="#{key.property}"/>
</ui:define>
</ui:composition>
@Rokko11
Rokko11 / EventContainer.java
Created November 5, 2015 10:17
Documentation, how to use a composite component together with JavaEE-events.
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;
/**
* Klasse, die das zu feuernde Event beinhaltet.
* Diese wird benoetigt, da bei JSF < 2.2 keine DI in Komponenten moeglich ist.
*/
@Named
public class EventContainer {