ConfirmDialog on TabClose event

UI Components for JSF
Post Reply
MadNeox
Posts: 3
Joined: 07 Feb 2015, 12:16

04 Mar 2015, 13:08

How can I process the operation of closing a tab depending of a user's confirmDialog action ? "yes" to continue closing the tab, "No" to abort the operation. I have made this code below but the tab is closed anyway. Any suggestions please ?

I am using Primefaces 5.1

Code: Select all

<p:confirmDialog    closable="true" appendToBody="true" id="confirmDialog" message="Are you sure to close ?" header="Test"  widgetVar="confirmation">  
    <h:form>
        <p:commandButton id="confirm" value="Yes" onclick="????;" oncomplete=" PF('confirmation').hide();"/>  
        <p:commandButton id="decline" value="No" onclick="PF('confirmation').hide()" /> 
    </h:form>
    </p:confirmDialog>

<p:tabView  onTabClose="PF('confirmation').show();">
        <p:tab title="test tab" closable="true" >
           // Some inputs controls here
        </p:tab>
    </p:tabView>
I am using Primefaces 5.1

MadNeox
Posts: 3
Joined: 07 Feb 2015, 12:16

05 Mar 2015, 14:45

Any help please ?
Thank you guys.


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 60 guests