cancel tab closing in p:accordionPanel
问题 I have a p:accordionPanel and inside of each tab of the panel there is some info that the user can manipulate, what i need to do is if the user close the tab show a confirm dialog (before the tab get closed) whit something like "are you sure you wanna close the tab? if you do your changes will be lost". here is what i tried <p:ajax event="tabClose" onstart="return myFunction()" listener" {myBean.myMethod}" process="@this" /> function myFunction() { var answer = confirm("are you sure you wanna