我试图在点击PrimeFace CommandLink时打开PrimeFace ConfirmDialog.但是当点击链接时,对话框会暂时打开,但会立即消失,我猜这个页面正在提交.这是代码:
<p:commandLink value="Delete" onclick="confirmation.show()" />
<p:confirmDialog message="Are you sure, you want to delete ?" header="Initiating deleting process" widgetVar="confirmation">
<p:commandButton value="Yes Sure" onclick="confirmation.hide()" actionListener="#{adminCtrl.deleteUserById}" update="userData" >
<f:attribute name="delete" value="#{user.userId}" />
</p:commandButton>
<p:commandButton value="Not Yet" onclick="confirmation.hide()" type="button" />
</p:confirmDialog>
Run Code Online (Sandbox Code Playgroud)
如何通过这种方式使对话框保持打开状态?
在PrimeFace ShowCase中,该示例处理CommandButton并且该工作正常,但我的要求是使用CommandLink.
可能吗?任何指针都对我很有帮助.