当我尝试使用 java 调用 primefaces 中的方法时,p:confirmDialog 不起作用

p:confirmDialog is not working when I try to call a method in primefaces with java

我有一个按钮可以通过一些代码触发一个方法,但现在我正在尝试设置一条确认消息,以防用户误点击该按钮。我在 primefaces 上看到 confirmDialog 并且我编写了代码,但它不起作用。当我点击按钮时,确认信息出现,但是当我点击是按钮时没有任何反应。

这是我的代码:

    <h:form id="forma" prependId="false">
        <p:growl id="messages" showDetail="true" sticky="true" />  
        <p:confirmDialog global="true">
            <p:commandButton value="Yes" type="button" />
            <p:commandButton value="No" type="button" />
        </p:confirmDialog>
        <div align="center">
            <p:commandButton id="botonCveGeo" 
                             value="Iniciar proceso" 
                             style="width:130px;height:25px;" 
                             update="messages"
                             ajax="false"
                             actionListener="#{actCveGeo.procesoActCveGeo()}"
                             title="Inicia proceso de actualizar clave geoestadistica">
                <p:confirm header="Confirm" message="Are you sure?" icon="ui-icon-alert"/>
            </p:commandButton>
        </div>
    </h:form>

你知道哪里出了问题吗?

谢谢

@tsotzolas 是正确的这是你的问题已经在 PF 中报告:https://github.com/primefaces/primefaces/issues/99

您目前无法将 ajax=false 用于确认对话框行为。

如果您明确需要此行为,请对该问题进行投票。