关于confirmdialog关闭的ajax更新

时间:2013-07-25 16:42:24

标签: primefaces

我正在使用primefaces 3.4,我是关于primefaces的新手,我想通过ajax更新一个面板,关闭一个confirmdialog这里是我的代码

<p:confirmDialog message="Are you sure?" header="Perform Action"
            severity="alert" widgetVar="confirmation">
            <p:commandButton value="Yes Sure"
                action="#{granteeSelectionManager.confirm}" oncomplete="confirmation.hide()" immediate="true" />
            <p:commandButton value="Not1 Yet"   
                action="#{granteeSelectionManager.cancelConfirm}"  update="reportingPeriod"
                oncomplete="confirmation.hide()"  />

        </p:confirmDialog>

尝试在confirmdailog中使用p:ajax,但是它给出了错误,我可以使用任何关闭事件属性吗? 请指教。

1 个答案:

答案 0 :(得分:0)

您应该在帖子中附上错误消息,但我猜错误是“无法将&lt; p:ajax&gt;附加到非ClientBehaviorHolder父级”,这意味着ajax只能嵌套在UIComponent中它实现了ClientBehaviorHolder接口。

我不确定为什么在有人关闭确认对话框时会执行更新,但是当您按下YES / NO按钮时可以执行更新。

您还可以通过设置closable =“false”属性来禁用关闭图标,该属性会强制用户按是或否

相关问题