How to let <f:facet> contain multiple components? It shows only the first

怎甘沉沦 提交于 2019-12-18 11:29:47

问题


I use <f:facet> to create a table header and I want a symbol beside it. However, it doesn't seem to work well. The symbol is not rendered.

JSF:

<h:column id="subject_column">
  <f:facet name="header">
    <h:commandLink value="Subject" id="sort_by_subjects"
                   action="#{xxx.sort}">
      <f:param id="sortBySubject" name="sortBy" value="SUBJECT"/>
    </h:commandLink>
    <span>${isAscending}</span>
  </f:facet>
  <h:outputText value="#{email.emailSubject}"/>
</h:column>

${isAscending} contains the arrow symbol and represents the order. I would like to show it beside <h:commandLink>.


回答1:


The <f:facet> can have only one child. Wrap multiple children in a <h:panelGroup>.

<h:column>
    <f:facet name="header">
        <h:panelGroup>
            <h:commandLink ... />
            <h:outputText ... />
        </h:panelGroup>
    </f:facet>
    ...
</h:column>



回答2:


The <f:facet> can have only one child. Wrap it in a <h:panelGroup> or <h:panelGrid>.



来源:https://stackoverflow.com/questions/9730924/how-to-let-ffacet-contain-multiple-components-it-shows-only-the-first

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!