Don't put HTML in a facet, put a JSF component as the child. If you
need to, use h:panelGroup or tr:group or some other really simple JSF
component to wrap the content.

EX:

<f:facet name="blah"><h:panelGroup>...inline content like
HTML...</h:panelGroup></f:facet>

This happens because of how inline HTML is treated in JSP and
Facelets. Take this for example:

<b><h:outputText /></b>

This looks like this in the component tree:

StaticTextComponent ("<b>")
OutputComponent
StaticTextComponent ("</b>")

So there are actually 3 components created, all 3 of them siblings. So
even though the template XML is hierarchical, the produced components
are not.

-Andrew

On Mon, Oct 6, 2008 at 9:46 AM, laredotornado <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using MyFaces 1.1.6, Tomahawk 1.1.7 on WebLogic 9.2.2.  I want to
> display a row of command buttons in the footer of my dataTable.  But I'm
> getting the error:
>
> facet 'footer' already has a child associated. current associated component
> id: dt1:_idJsp56 class: javax.faces.component.html.HtmlCommandButton
>
> Caused by:
> java.lang.IllegalStateException - facet 'footer' already has a child
> associated. current associated component id: dt1:_idJsp56 class:
> javax.faces.component.html.HtmlCommandButton
>
> Here's what I'm trying to do.  Any ideas how to correct?  Thanks, - Dave
>
>                        <h:dataTable id="dt1" value="#{SearchBean.results}"
> var="item" bgcolor="#F1F1F1" border="10" cellpadding="5" cellspacing="3"
> dir="LTR" frame="hsides" rules="all" >
>
> ...
>                                <f:facet name="footer">
>
>                                                <table width="100%"
> align="center">
>                                                        <tr>
>
> <td><h:commandButton value="First" action="#{SearchResultsPage.first}"
> styleClass="npsButton"
>
> onmouseover="hoverGridButton(this)"
>
> onmouseout="unhoverGridButton(this)" rendered="#{SearchResultsPage.curPage
> != 1}" /></td>
>
> <td><h:commandButton value="Previous" action="#{SearchResultsPage.previous}"
> styleClass="npsButton"
>
> onmouseover="hoverGridButton(this)"
>
> onmouseout="unhoverGridButton(this)"  rendered="#{SearchResultsPage.curPage
> != 1}" /></td>
>
> <td><h:commandButton value="Next" action="#{SearchResultsPage.next}"
> styleClass="npsButton"
>
> onmouseover="hoverGridButton(this)"
>
> onmouseout="unhoverGridButton(this)"   rendered="#{SearchResultsPage.curPage
> != SearchResultsPage.lastPage}" /></td>
>
> <td><h:commandButton value="Last" action="#{SearchResultsPage.last}"
> styleClass="npsButton"
>
> onmouseover="hoverGridButton(this)"
>
> onmouseout="unhoverGridButton(this)"  rendered="#{SearchResultsPage.curPage
> != SearchResultsPage.lastPage}" /></td>
>                                                        </tr>
>                                                </table>
>
>                                </f:facet>
>                        </h:dataTable>
>
> --
> View this message in context: 
> http://www.nabble.com/facet-%27footer%27-already-has-a-child-associated---tp19840555p19840555.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Reply via email to