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.

kukeltje
Expert Member
Posts: 9408
Joined: 17 Jun 2010, 13:34
Location: Netherlands

05 Mar 2015, 16:22

Ronald van Kuijk
______________________________
PrimeFaces 6.1, PrimeFaces plus 0.0.2 | JbossWildfly 10.1| Mojarra 2.2.13
Fedora 61, Firefox 'most recent'
Read the forum posting rules
Beginners: https://jsf.zeef.com/bauke.scholtz

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests