JSF PrimeFaces,如何仅刷新<;p:LayoutUnitPosition=";中心“&燃气轮机;而是全部<;p:布局>?

JSF PrimeFaces,如何仅刷新<;p:LayoutUnitPosition=";中心“&燃气轮机;而是全部<;p:布局>?,jsf,primefaces,Jsf,Primefaces,我有一个布局,其中包含layoutUnit west和layoutUnit center,西侧有一个菜单,可以调用另一个在中心侧呈现的页面,问题是当另一个页面在中心呈现时,所有布局都会刷新(西侧和中心侧)。我有以下代码: <p:layout style="width: 100%; height: 450px" > <p:layoutUnit position="west" size="230" collapsible="false" >

我有一个布局,其中包含layoutUnit west和layoutUnit center,西侧有一个菜单,可以调用另一个在中心侧呈现的页面,问题是当另一个页面在中心呈现时,所有布局都会刷新(西侧和中心侧)。我有以下代码:

<p:layout style="width: 100%; height: 450px" >
                <p:layoutUnit position="west" size="230" collapsible="false" >
                    <h:form>                        

                        <p:menu style="font-size: 14px;  width: 95%;height: 420px " >
                            <p:submenu label="MENU">

                                <p:menuitem value="Students"  icon="ui-icon-arrowthick-1-n" url="pantallas/students.xhtml"  />    
                                <p:menuitem value="Teachers"  icon="ui-icon-refresh" url="pantallas/teacher.xhtml"  />


                            </p:submenu>


                        </p:menu>
                    </h:form> 

                </p:layoutUnit>

                <p:layoutUnit id="layout1" position="center" >
                    <h:form>
                        <ui:insert name="content" ></ui:insert>
                    </h:form>


                </p:layoutUnit>

            </p:layout>

和student.xhtml类似:

<ui:composition template="../administracion.xhtml"
            xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://xmlns.jcp.org/jsf/html"
            xmlns:p="http://primefaces.org/ui"
            xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
            xmlns:f="http://xmlns.jcp.org/jsf/core">
<ui:define name="content">
    <h:head>
        <h:outputStylesheet library="css" name="styles2.css"/>
        <title>Facelet Title</title>
    </h:head>

    <h:body>
        <p:panel header="Student" style="width: 90%; margin: auto auto">
            <h:form id="forma1">
                <p:panel style="text-align: center">
                    <p:inputText placeholder="Students" value="#{datosCT.cct}"/>
                    <p:commandButton value="buscar" actionListener="#{controlCTAlumnos.traeInfo()}" update="panel1">
                        <f:ajax listener="#{controlCTAlumnos.mostrarPanel(e)}" render="panel1"  />
                    </p:commandButton>

                </p:panel>

            </h:form>
        </p:panel>

    </h:body>
</ui:define>

Facelet标题

我看到并尝试了许多只刷新layoutUnit中心的方法,但在这种情况下不起作用

有人能帮我吗


提前感谢。

您可以从内容页对布局单元内的表单组件进行部分更新

<p:layoutUnit id="layout1" position="center" >
    <h:form id="form>
       <ui:insert name="content" ></ui:insert>
    </h:form>
</p:layoutUnit>


你不应该直接把
放在
里面。将它们全部分开,将每个单元的内容放在各自单独的XHTML文件中(通常位于
WEB-INF
文件夹下),并使用
将它们包含在母版页模板中(
内的
标记是多余的,不再需要)。您始终可以使用容器组件(如
)来封装要更新/渲染的感兴趣的组件。
<p:commandButton value="buscar" update=":form"/>