Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a composite component for a datatable column?
    primarykey
    data
    text
    <p>Given this datatable (naturally working):</p> <pre><code>&lt;rich:dataTable var="var" value="#{values}"&gt; &lt;rich:column&gt; &lt;f:facet name="header"&gt; HEADER &lt;/f:facet&gt; &lt;h:outputText value="#{var}" /&gt; &lt;/rich:column&gt; &lt;/rich:dataTable&gt; </code></pre> <p>If I define a custom component (also ok in the syntax and at the right place under resources/components):</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;html 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:composite="http://java.sun.com/jsf/composite"&gt; &lt;!-- INTERFACE --&gt; &lt;composite:interface&gt; &lt;composite:attribute name="val" /&gt; &lt;/composite:interface&gt; &lt;!-- IMPLEMENTATION --&gt; &lt;composite:implementation&gt; &lt;rich:column&gt; &lt;f:facet name="header"&gt; HEADER &lt;/f:facet&gt; &lt;h:outputText value="#{cc.attrs.val}" /&gt; &lt;/rich:column&gt; &lt;/composite:implementation&gt; &lt;/html&gt; </code></pre> <p>Why does the following does not work?</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ui:composition template="/WEB-INF/templates/default.xhtml" 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:my="http://java.sun.com/jsf/composite/components"&gt; &lt;ui:define name="content"&gt; &lt;rich:dataTable var="var" value="#{values}"&gt; &lt;my:mycolumn val="#{var}"/&gt; &lt;/rich:dataTable&gt; &lt;/ui:define&gt; &lt;/ui:composition&gt; </code></pre> <p>Do you know how could I let it work (I want to define my own column and save code)? Thanks a lot! Bye</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload