确认对话框 Primefaces

发布于 2024-11-08 04:02:46 字数 2584 浏览 2 评论 0原文

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

<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>

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

..Now I come across a question.

<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>

when user change the priority of the table, and the user moves a request(s) and then selects another tab without saving the request.Must display a confirmationDialog.
So I don't know how to do it.AnyOne can help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌路终见情 2024-11-15 04:02:46

您有什么理由不使用 window.confirm() ? (请参阅http://www.w3schools.com/js/js_popup.asp

Any reason why you don't use window.confirm() ? (see http://www.w3schools.com/js/js_popup.asp)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文