Jini Samuel
Jini Samuel

Reputation: 124

Opening one <p:confirmDialog> from another <p:confirmDialog> in JSF

I have a JSF page in which I have two dialogs. I want to open one dialog on closing the other.I am using Primefaces 4.0. Here is my JSF page.

<h:form>


        <h:commandLink value="Click me" onclick="bezoekConfirmation.show();return false;"/>

            <p:confirmDialog
                message="Bent u zeker dat u dit bezoek wilt verwijderen?"
                closable="false" header="Bezoek verwijderen" severity="alert"
                widgetVar="bezoekConfirmation">
                <p:commandButton value="Yes" oncomplete="bezoekConfirmation.hide()"
                    onclick="dialog.show();" ajax="false" />
                <p:commandButton value="No" onclick="bezoekConfirmation.hide()"
                    type="button" />


            </p:confirmDialog>

            <p:confirmDialog message="Hai" closable="false"
                header="Bezoek verwijderen" severity="alert" widgetVar="dialog">
                <p:commandButton value="Yes" oncomplete="dialog.hide()"
                    action="#{controller.method()}" ajax="false" />
                <p:commandButton value="No" onclick="dialog.hide()" type="button" />


            </p:confirmDialog>




        </h:form>

The first dialog appears. But on clicking the yes button of the first dialog, the second dialog never appears.

However the logic requires both the dialogs to appear one after the other.

Am I missing something?

Upvotes: 0

Views: 1262

Answers (1)

junior developper
junior developper

Reputation: 448

Remove ajax="false" from the command Button and it will works

Upvotes: 2

Related Questions