确认对话框Primefaces



..现在我遇到了一个问题。

<tabview>
<tab>...
</tab>
<tab>...
</tab>
<tab>...
</tab>
<tab id="p">
    <h:form id="qorm">
        <h:panelGroup >
            <p:commandButton value="Save"  actionListener="#{...}" update="priorityDataTable" />
            <p:commandButton id="cancelButton" value="Cancel"
onclick="confirmation.show()"   type="button" />
        </h:panelGroup>
        <p:dataTable id="priorityDataTable"
        styleClass="priorityDataTable"
            selection="#{...selectedJobQueue}"
            rowSelectListener="#{...onRowSelect}"
            selectionMode="single"
            value="#{....priorityList}" var="priority"
            >
            <p:column>
                <f:facet name="header"> 
                        Request<br />Number
                    </f:facet>
                <h:outputText value="#{priority.reworkRequest.requestNumber}" />
            </p:column>
            <p:column>
                <f:facet name="header"> 
                        #
                    </f:facet>
                <h:outputText value="#" />
            </p:column>
            <p:column>
                <f:facet name="header"> 
                        Status
                    </f:facet>
                <h:outputText value="#{priority.priorityStatus.getTextValue()}" />
            </p:column>
        </p:dataTable>
        <h:panelGroup class="queuePriorityActionButton">
            <p:commandButton id="moveUpButton" value="Move Up" actionListener="#{....moveUp()}" />
            <p:commandButton id="moveDownButton" value="Move Down" actionListener="#{....moveDown()}"  />
        </h:panelGroup>
        </h:form>
        <h:form>
        <p:confirmDialog message="All updates since your last save will be lost.  Are you sure you want to exit?" modal="true"
        header="Initiating destroy process" severity="alert" widgetVar="confirmation">      
            <p:commandButton value="Yes Sure" update="queuePriorityForm:priorityDataTable "  oncomplete="confirmation.hide()"
        actionListener="{....resetBack()}"  />
            <p:commandButton value="Not Yet" onclick="confirmation.hide()" type="button" /> 
        </p:confirmDialog>
        </h:form>
</tab>
</tabview>

当用户更改表的优先级,并且用户移动请求,然后选择另一个选项卡而不保存请求时。必须显示确认对话框。所以我不知道该怎么做。任何人都可以帮助我

你不使用window.confirm()的任何原因?(见 http://www.w3schools.com/js/js_popup.asp)

最新更新