1

それについて別の質問がありますが、私はそれで問題を解決できませんでした。 jsfとprimefacesの更新の問題

どのレベルから始めるのが正しいですか? messagePanel-messages を更新したいだけですが、何が問題なのですか。5 つの異なる解決策を試しましたが、成功しませんでした。

<ui:composition template="./template.xhtml">

    <ui:define name="title">
        <h:outputText value="#{bundle.editXTZ_title} - #{XTZBean.username} - -->: #{RmaBean.selectedRma.rma}"></h:outputText>
    </ui:define>
    <h:panelGroup id="messagePanel" layout="block">
        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
    </h:panelGroup>
    <ui:define name="body">
        <h:form id="formi">
            <p:accordionPanel activeIndex="#{XTZBean.activeIndex}">  
                <p:tab title="Muokkaa"> 

……コードを追加してから

                <p:tab title="Avainsanat">  

                        <p:panelGrid id="avainsanaGrid" style="margin-top:20px;" styleClass="noBorders">
                            <p:row>
                                <p:column></p:column>
                                <p:column></p:column>


<p:row rendered="#{XTZBean.suljettu}">
                                <p:column></p:column>
                                <p:column></p:column>
                                <p:column><p:commandButton value="Tallenna" id="btnAvainsana" process="@this,avainsana" update="avainsanaGrid, :messagePanel"  
                                                           actionListener="#{XTZBean.talletaAvainsana}" style="width: 210px;"/></p:column>
                                <p:column></p:column>
                                <p:column></p:column>
                                <p:column></p:column>
                                <p:column></p:column>
                            </p:row> 
                         </p:panelGrid>  
                    </p:tab>

ありがとう!サーミ語

4

1 に答える 1

3

これまでに与えられた情報に基づいて (および<ui:insert name="body">が別のNamingContainerコンポーネントに単独で存在しないことを前提として)、:messagePanelは正しいです。

しかし、それ<h:panelGroup id="messagePanel">は適切な場所ではありません。これは完全にテンプレート定義の外にあるため、完全に無視されます。のいずれかに配置する必要があり<ui:define>ます。

例えば

<ui:define name="body">
    <h:panelGroup id="messagePanel" layout="block">
        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
    </h:panelGroup>

    <h:form id="formi">
        ...
    </h:form>
</ui:define>

以下も参照してください。

于 2012-11-01T12:49:49.253 に答える