1

わかりました、この問題は私を狂わせています....

私はこのxhtmlページを2つのダイアログで持っています...両方のダイアログには、サーバーに送信を送信するためのフォームがあり、正常に動作しますが、commandLinkフォームから呼び出されて更新されると、ダイアログフォームのactionListenerは機能しませんうまくいきません、何かアイデアはありますか?

これは、ダイアログを呼び出すメニューです

<ui:define name="left">
    <h:form id="menuForm">
        <div class="sidebar-nav">
            <div class="well" style="width:150px; padding: 8px 0;">
                <ul class="nav nav-list"> 
                    <li class="text-center">Options</li>        
                    <li><p:commandLink id="createLink" update=":LocationCreateForm" actionListener="#{locationController.prepareCreate}" oncomplete="LocationCreateDialog.show()"><span class="glyphicon glyphicon-user"></span> Create New</p:commandLink> </li>
                    <li><p:commandLink id="editLink" update=":LocationEditForm" oncomplete="LocationEditDialog.show()"><span class="glyphicon glyphicon-edit"></span> Update</p:commandLink> </li>
                    <li><p:commandLink id="deleteLink" actionListener="#{locationController.delete}"><span class="glyphicon glyphicon-ban-circle"></span> Delete</p:commandLink> </li>
                </ul>
            </div>
        </div>
    </h:form>
</ui:define>

commandLink から更新を削除すると機能しますが、編集ダイアログでは編集する情報を取得できません。

ダイアログとリストは次のとおりです。

<ui:define name="content">
    <h1>Locations</h1>
    <!-- Location List -->
    <h:form id="LocationListForm">

        <p:dataTable id="datalist" value="#{locationController.items}" var="item"
                     selectionMode="single" selection="#{locationController.selected}"
                     rowKey="#{item.id}"

                     >

            <p:column sortBy="#{item.id}" filterBy="#{item.id}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_id}"/>
                </f:facet>
                <h:outputText value="#{item.id}"/>
            </p:column>
            <p:column sortBy="#{item.name}" filterBy="#{item.name}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_name}"/>
                </f:facet>
                <h:outputText value="#{item.name}"/>
            </p:column>
            <p:column sortBy="#{item.openingHourMonday}" filterBy="#{item.openingHourMonday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourMonday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourMonday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourTuesday}" filterBy="#{item.openingHourTuesday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourTuesday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourTuesday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourWednesday}" filterBy="#{item.openingHourWednesday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourWednesday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourWednesday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourThrusday}" filterBy="#{item.openingHourThrusday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourThrusday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourThrusday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourFriday}" filterBy="#{item.openingHourFriday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourFriday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourFriday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourSaturday}" filterBy="#{item.openingHourSaturday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourSaturday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourSaturday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
            <p:column sortBy="#{item.openingHourSunday}" filterBy="#{item.openingHourSunday}">
                <f:facet name="header">
                    <h:outputText value="#{myBundle.ListLocationTitle_openingHourSunday}"/>
                </f:facet>
                <h:outputText value="#{item.openingHourSunday}">
                    <f:convertDateTime pattern="HH:mm:ss" />
                </h:outputText>
            </p:column>
        </p:dataTable>
    </h:form>
    <!-- Location Create Dialog -->
    <p:dialog id="LocationCreateDlg" widgetVar="LocationCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateLocationTitle}">

        <h:form id="LocationCreateForm">

            <h:panelGroup id="display">
                <p:panelGrid columns="2" >

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_name}" for="name" />
                    <p:inputText id="name" value="#{locationController.selected.name}" title="#{myBundle.CreateLocationTitle_name}" required="true" requiredMessage="#{myBundle.CreateLocationRequiredMessage_name}"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourMonday}" for="openingHourMonday" />
                    <p:calendar id="openingHourMonday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourMonday}" title="#{myBundle.EditLocationTitle_openingHourMonday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourMonday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourTuesday}" for="openingHourTuesday" />
                    <p:calendar id="openingHourTuesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourTuesday}" title="#{myBundle.EditLocationTitle_openingHourTuesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourTuesday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourWednesday}" for="openingHourWednesday" />
                    <p:calendar id="openingHourWednesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourWednesday}" title="#{myBundle.EditLocationTitle_openingHourWednesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourWednesday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourThrusday}" for="openingHourThrusday" />
                    <p:calendar id="openingHourThrusday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourThrusday}" title="#{myBundle.EditLocationTitle_openingHourThrusday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourThrusday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourFriday}" for="openingHourFriday" />
                    <p:calendar id="openingHourFriday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourFriday}" title="#{myBundle.EditLocationTitle_openingHourFriday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourFriday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourSaturday}" for="openingHourSaturday" />
                    <p:calendar id="openingHourSaturday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSaturday}" title="#{myBundle.EditLocationTitle_openingHourSaturday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSaturday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourSunday}" for="openingHourSunday" />
                    <p:calendar id="openingHourSunday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSunday}" title="#{myBundle.EditLocationTitle_openingHourSunday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSunday}" showOn="button"/>
                </p:panelGrid>
                <p:commandButton actionListener="#{locationController.saveNew}" value="#{myBundle.Save}" update="display,:LocationListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,LocationCreateDialog);"/>
                <p:commandButton value="#{myBundle.Cancel}" onclick="LocationCreateDialog.hide();"/>
            </h:panelGroup>

        </h:form>

    </p:dialog>

    <!-- Location Update Dialog -->
    <p:dialog id="LocationEditDlg" widgetVar="LocationEditDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.EditLocationTitle}">

        <h:form id="LocationEditForm">

            <h:panelGroup id="display">
                <p:panelGrid  columns="2" rendered="#{locationController.selected != null}">

                    <h:outputLabel value="#{myBundle.EditLocationLabel_id}" for="id" />
                    <h:outputText id="id" value="#{locationController.selected.id}" />

                    <p:outputLabel value="#{myBundle.EditLocationLabel_name}" for="name" />
                    <p:inputText id="name" value="#{locationController.selected.name}" title="#{myBundle.EditLocationTitle_name}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_name}"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourMonday}" for="openingHourMonday" />
                    <p:calendar id="openingHourMonday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourMonday}" title="#{myBundle.EditLocationTitle_openingHourMonday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourMonday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourTuesday}" for="openingHourTuesday" />
                    <p:calendar id="openingHourTuesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourTuesday}" title="#{myBundle.EditLocationTitle_openingHourTuesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourTuesday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourWednesday}" for="openingHourWednesday" />
                    <p:calendar id="openingHourWednesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourWednesday}" title="#{myBundle.EditLocationTitle_openingHourWednesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourWednesday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourThrusday}" for="openingHourThrusday" />
                    <p:calendar id="openingHourThrusday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourThrusday}" title="#{myBundle.EditLocationTitle_openingHourThrusday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourThrusday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourFriday}" for="openingHourFriday" />
                    <p:calendar id="openingHourFriday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourFriday}" title="#{myBundle.EditLocationTitle_openingHourFriday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourFriday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourSaturday}" for="openingHourSaturday" />
                    <p:calendar id="openingHourSaturday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSaturday}" title="#{myBundle.EditLocationTitle_openingHourSaturday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSaturday}" showOn="button"/>

                    <p:outputLabel value="#{myBundle.EditLocationLabel_openingHourSunday}" for="openingHourSunday" />
                    <p:calendar id="openingHourSunday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSunday}" title="#{myBundle.EditLocationTitle_openingHourSunday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSunday}" showOn="button"/>
                </p:panelGrid>
                <p:commandButton actionListener="#{locationController.save}" value="#{myBundle.Save}" update="display,:LocationListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,LocationEditDialog);"/>
                <p:commandButton value="#{myBundle.Cancel}" onclick="LocationEditDialog.hide();"/>
            </h:panelGroup>

        </h:form>

    </p:dialog>

</ui:define>
4

2 に答える 2

0

問題を解決、primefaces 4.0 RC1 に更新、変更appendToBody="true"appendTo="@(body)"

于 2013-10-01T15:52:37.550 に答える