【问题标题】:p:tabView tab with ui:include src not maintaining seperate tabsp:tabView 带有 ui:include src 的选项卡不维护单独的选项卡
【发布时间】:2015-12-19 18:36:16
【问题描述】:

我正在使用带有标签的 primefaces tabview 来分离数据。当我使用 ui:include src 在包含 src 代码中的选项卡代码上包含一个带有保存按钮的数据表时,我得到一个不包含在选项卡中的保存按钮

这是标签代码

<p:tab title="Event Costs" disabled="#{eventCreateEditModel.projectEvent.projectEventId==0}">
                    <p:panelGrid id="costsPanelGrid">
                        <ui:include src="eventCreateEditCosts.xhtml"/>
                        <p:row>
                            <p:column colspan="2"> <p:commandButton value="Save" actionListener="#{eventCreateEditModel.update}" update="@form"/></p:column>
                        </p:row>
                    </p:panelGrid>
                </p:tab>

这是数据表代码

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:p="http://primefaces.org/ui">

         <p:panel header="Audits List" update="@form" closable="false"  >
            <p:panelGrid  columns="3">
                <p:dataTable value="#{eventCreateEditCostModel.costEntities}" var="eventCost"
                             rowKey="#{eventCost.eventCostId}"
                             sortMode="multiple"
                             resizableColumns="true"
                             widgetVar="eventCostTable"
                              rows="10">
                    <f:facet name="header">
                        Event Audit Listing
                    </f:facet>
                    <p:column headerText="ID">
                        <h:outputText value="#{eventCost.eventCostId}" />
                    </p:column>
                </p:dataTable>
            </p:panelGrid>
            </p:panel>

保存按钮不包含在选项卡内,而是显示在选项卡外。

有人见过这种问题吗?是否有另一种包含来源的方式?

【问题讨论】:

    标签: jsf primefaces tabs


    【解决方案1】:

    该问题仅通过在选项卡中包含一个包含 src 来解决。我必须使用保存按钮删除面板网格和行/列,才能使 tabview 正常工作。我将面板网格和保存按钮放在 eventCreateEdtCosts.xhtml 文件中。这违背了我的可重用组件的目标,但确实解决了选项卡显示问题。

    <p:tab title="Event Costs" disabled="#{eventCreateEditModel.projectEvent.projectEventId==0}">
                        <ui:include src="eventCreateEditCosts.xhtml"/>
                </p:tab>
    

    【讨论】:

      猜你喜欢
      • 2017-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-07
      • 2014-01-27
      • 1970-01-01
      • 1970-01-01
      • 2020-12-03
      相关资源
      最近更新 更多