<context-param> <param-name>org.richfaces.enableControlSkinning</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.richfaces.enableControlSkinningClasses</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.richfaces.skin</param-name> <param-value>blueSky</param-value> </context-param>
<h:form id="tree-form">
<rich:tree id="tree" value="#{bean.tree}" selectionType="ajax">
<rich:treeSelectionChangeListener listener="#{bean.changeSelection}"/>
<rich:treeNode>
<h:outputText value="#{node.name}"/>
</rich:treeNode>
</rich:tree>
</h:form>
public void changeSelection(TreeSelectionChangeEvent event) {
System.out.println("Selection changed: " + event.getNewSelection());
}
<h:outputScript name="collapsible-subtable.js" library="org.richfaces"/> <h:outputStylesheet name="collapsible-subtable.ecss" library="org.richfaces"/>
Ein anderes Problem ist das Verschlucken von AJAX-Fehlermeldungen. Richfaces registriert mit jsf.ajax.addOnError(onError) einen eigenen Error-Handler, in dessen Code dann steht "//TODO: what if somebody is going to clear queue on error?". Abhilfe schafft das Registrieren eines weiteren Error-Handlers mit einer sinnvollen Ausgabe:
<c:if test="#{facesContext.application.projectStage == 'Development'}">
<script type="text/javascript">
jsf.ajax.addOnError(function (data) {
alert(data.description);
});
</script>
</c:if>