1

Java Server Faces Web アプリケーション開発で Primefaces コンポーネント フレームワークを使用しています。過去2日間、この問題に直面しました。2 つをレンダリングする統計入力スイッチ コンポーネントをクリックすると、p:commandButtonその後 5 つをレンダリングするスイッチ計画入力をクリックすると、p:commandButtonこれらのボタンは、更新レンダリングがうまく機能しているにもかかわらず、バック Bean の変数という名前のアクションを設定しません。下の2枚の写真をご覧ください

ここに画像の説明を入力

機能しないボタン

ここに画像の説明を入力

条件付きでレンダリングされたコンポーネントがバック Bean に接続されていないと想定しています。アプリケーション全体で ajax レンダリングされたコンポーネントが認識されない可能性があります。f:setPropertyActionListenerバッキング アクション Bean 変数の設定に使用しています。

    <p:tab title="#{lang['top_menu_statistic_planning']}">
        <p:ribbonGroup>
            <h:form>
                <div class="statistic-planning-switcher-parts">
                    <p:inputSwitch onLabel="Statistic" offLabel="Planning"
                        value="#{selectBooleanView.value2}">
                        <p:ajax listener="#{selectBooleanView.addMessage}"
                            update=":mainReportSubViewsRenderID :mainViewsRenderID" />
                    </p:inputSwitch>
                </div>
            </h:form>
        </p:ribbonGroup>
        <p:ribbonGroup label="">
            <h:panelGroup id="mainReportSubViewsRenderID">
                <h:panelGroup
                    rendered="#{selectBooleanView.addMessage() == 'Checked'}">
                    <p:commandButton value="Import-1" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomout" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_statistic.import"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                    <p:commandButton value="Export" update=":mainViewsRenderID"
                        icon="fa fa-asterisk" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_statistic.export"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                </h:panelGroup>
                <h:panelGroup
                    rendered="#{selectBooleanView.addMessage() == 'Unchecked'}">
                    <p:commandButton value="Button-1" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomin" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_planning.section1"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                    <p:commandButton value="Button-2" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomin" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_planning.section2"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                    <p:commandButton value="Button-3" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomout" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_planning.section3"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                    <p:commandButton value="Button-4" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomin" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_planning.section4"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                    <p:commandButton value="Button-5" update=":mainViewsRenderID"
                        icon="ui-ribbonicon-zoomout" styleClass="ui-ribbon-bigbutton">
                        <f:setPropertyActionListener value="report_planning.section5"
                            target="#{hometabmanager.action}" />
                    </p:commandButton>
                </h:panelGroup>
            </h:panelGroup>
        </p:ribbonGroup>
    </p:tab>

---------上記のコードは下のパネルグリッドにレンダリングされます ----------------------------------

            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_planning.section1'}">
                <ui:include src="/views/report/report_section1.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_planning.section2'}">
                <ui:include src="/views/report/report_section2.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_planning.section3'}">
                <ui:include src="/views/report/report_section3.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_planning.section4'}">
                <ui:include src="/views/report/report_section4.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_planning.section5'}">
                <ui:include src="/views/report/report_section5.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_statistic.import' and selectBooleanView.subSectionPageBlock == 'block-statistic'}">
                <ui:include src="/views/report/report_import2.xhtml" />
            </h:panelGroup>
            <h:panelGroup
                rendered="#{hometabmanager.action == 'report_statistic.export' and selectBooleanView.subSectionPageBlock == 'block-statistic'}">
                <ui:include src="/views/report/report_export.xhtml" />
            </h:panelGroup>
4

0 に答える 0