Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf Primefaces对话框actionlistener在更新时未触发_Jsf_Primefaces - Fatal编程技术网

Jsf Primefaces对话框actionlistener在更新时未触发

Jsf Primefaces对话框actionlistener在更新时未触发,jsf,primefaces,Jsf,Primefaces,好吧,这个问题快把我逼疯了 我有这个xhtml页面,有两个对话框。。。 两个对话框内部都有一个表单,用于向服务器发送提交,它们工作正常,但是当从commandLink表单调用和更新它们时,对话框表单中的actionListener就不工作了,有什么想法吗 这是我调用对话框的菜单 <ui:define name="left"> <h:form id="menuForm"> <div class="sidebar-nav">

好吧,这个问题快把我逼疯了

我有这个xhtml页面,有两个对话框。。。 两个对话框内部都有一个表单,用于向服务器发送提交,它们工作正常,但是当从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>

位置

已解决问题,更新为primefaces 4.0 RC1,更改为
appendToBody=“true”
,更改为
appendTo=“@(body)”
已解决问题,更新为primefaces 4.0 RC1,更改为
appendToBody=“true”
,更改为
appendTo=“@(body)”
使用
过程=“@this”
p:commandButton
appendTo=“@(body)”
中的
p:dialog
使用
process=“@this”
中的
p:commandButton
appendTo=“@(body)”
中的
p:dialog