相关疑难解决方法(0)

单击p:commandLink打开p:confirmDialog

我试图在点击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.

可能吗?任何指针都对我很有帮助.

java jsf dialog commandlink primefaces

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

commandlink ×1

dialog ×1

java ×1

jsf ×1

primefaces ×1