Uderc programming article aggregator sites

Component.getChilderen() does not include facelet tags

Answers: Have 2 answers
I’m writing a function to export a dataTable to excel.
Everything works fine! Except when my UIColumn has facelet tags inside.
for (int nr = uiData.getFirst(); nr < uiData.getRowCount(); nr++) {
     List<UIComponent> children = abstractTableComponent.getChildren();
     for(UIComponent child : children){
          xls.append(renderChild(new StringBuilder(), child));
public StringBuilder renderChild(StringBuilder builder, UIComponent component){
     if(component.getChildren() != null){
          for(UIComponent child : component.getChildren()){
               renderChild(builder, child);
     return builder;
}Example 1:
<f:facet name=”header”>
<h:outputText value=”#{e.person.email}” />
Result: <table><tr><td>[email protected]</td></tr></table>
Example 2:
<f:facet name=”header”>
Result: <table><tr><td></td></tr></table>
#{e.person.email} is not converted a a component, so it doesn’t have a value.
My question is how to get the value of a Facelets component.
Thanks in advance,
Edited by: Pieter_Pareit on Apr 19, 2010 5:34 AM
The best answer: I wouldn't call this a "Facelets Component", after all the issue is that it is not a component.
My advice would be if you want to ensure that everything is available for manipulation via the component tree you ought to make sure everything is a component. You could make this a component by surrounding it with ui:component or ui:fragment or the like.