7 Replies Latest reply on Oct 18, 2010 3:37 AM by Julien HENRY

    How to wrap rich:column in a facelet tag

    Julien HENRY Newbie

      Hi,

       

      I would like to create a custom facelet tag to add features to the existing rich:column tag.

       

      I have created the following file:

       

      column.xhtml

      {code:xml}

      <ui:composition xmlns:f="http://java.sun.com/jsf/core" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">

          <rich:column id="#{id}" filterBy="#{filterBy}">

              <f:facet name="header">

                  <h:outputText styleClass="headerText" value="#{header}" />

              </f:facet>

              <ui:insert/>

          </rich:column>

      </ui:composition>

      {code}

       

      then I use it this way:

       

       

      {code:xml}

      <rich:table var="person" ...>

         <my:column id="col1" header="Name" filterBy="#{person.name}">#{person.name}</my:column>

         <my:column id="col2" header="Age">#{person.age}</my:column>

      </rich:table>

      {code}

       

      The problem is the filter input field is displayed for the two columns even if I don't specify filterBy attribute.

       

      How can I set the filterBy attribute on rich:column only when it is also defined on the my:column tag?

       

      Thanks