webtier@glassfish.java.net

Nested Composite Component Doesn't work for table column

From: <webtier_at_javadesktop.org>
Date: Fri, 12 Feb 2010 07:05:28 PST

I have reported this issue as defect 1541 but I'm hoping someone my have a suggestion on a work around for this. Here is the issue

I am attempting to use composites to represent a table column. I have tried this with both IceFaces and the standard implementation. I have a custom component that is of type UIColumn that is being inserted into another composite that houses a table. The table renders and the column renders. However, the outputText that should represent the row data does not render. Interestingly this will render using composites when I don't have the column rendering as a composite (IE the table is contained in the composite and the row level output is contained in the top level page.). That is not my requirement though. This seems to be a tough cookie to crack. I have the source now and am starting to acquaint myself with it in an attempt to figure out what is going on. Any brilliant ideas out there?


Code is below.

tableColumn.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:ice="http://www.icesoft.com/icefaces/component"
         xmlns:composite="http://java.sun.com/jsf/composite">
   <h:head>
   </h:head>
   <h:body>
   <composite:interface componentType="MyColumn">
   </composite:interface>
   <composite:implementation>
   <ice:column headerText="Make" id="column3">
                <composite:insertChildren />
        </ice:column>
   </composite:implementation>
   </h:body>
   </html>

table.xhtml


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:ice="http://www.icesoft.com/icefaces/component"
         xmlns:composite="http://java.sun.com/jsf/composite">
   <h:head>
   <title></title>
   </h:head>
   <h:body>
   <composite:interface>
   </composite:interface>
   <composite:implementation>
<ice:dataTable augmentTitle="false"
                       rows="10"
                       value="#{SessionBean1.carDataProvider.tableDisplayList}"
                       var="item" >
<composite:insertChildren />
        </ice:dataTable>
   </composite:implementation>
   </h:body>
   </html>

Example Page
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      xmlns:temp="http://java.sun.com/jsf/composite/tempcomp"
    <h:head id="outputHead1">
    </h:head>
        <h:body>
        <ice:form id="form1">
        <temp:table>
                <temp:tableColumn>
            <ice:outputText id="outputText3" value="#{item.make}"/>
                </temp:tableColumn>
        </temp:table>
        </ice:form>
    </h:body>
</html>

The the new UIMyColumn class

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package icefacestestapp2;

import com.icesoft.faces.component.ext.UIColumn;
import javax.faces.component.FacesComponent;

@FacesComponent(value = "MyColumn")
public class MyColumn extends UIColumn {

    @Override
    public String getFamily() {
        return "custom";
    }

}




Interestingly the row text will not render even if I add it directly to the new
composite column class as seen below.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:ice="http://www.icesoft.com/icefaces/component"
         xmlns:composite="http://java.sun.com/jsf/composite">
   <h:head>
   </h:head>
   <h:body>
   <composite:interface componentType="MyColumn">
   </composite:interface>
   <composite:implementation>
   <ice:column headerText="Make" id="column3">
            <ice:outputText id="outputText3" value="#{item.make}"/>
        </ice:column>
   </composite:implementation>
   </h:body>
   </html>
[Message sent by forum member 'tracker09' (wjason_at_sbcglobal.net)]

http://forums.java.net/jive/thread.jspa?messageID=386385