Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6468897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:55:58+00:00 2026-05-25T05:55:58+00:00

I want to show a dialog box on the click of a primefaces commandbutton.

  • 0

I want to show a dialog box on the click of a primefaces commandbutton. Before the dialog box , I need to check a condtional.

I am using Spring web-flow 2.3.0.

So I am doing it like this ,

And the Dialog Box is

I am not able to show this dialog box based on this condition.

Please help me ,any pointers?

SWF 2.3.0 Primefaces 2.2.1 JSF 2 Spring Security 3 Spring 3.1.0M1I EhCache Apache Tomcat 6.0 STS 2.5.1

So I have changed my code as per below

                    <p:commandLink id="addRequest" immediate="true" value="addreq"
                    oncomplete="dlg3.show()" update="dialogPanel">
                    <f:setPropertyActionListener
                        value="#{searchHandler.selectedAccIns}"
                        target="#{reqSearchHandler.checkAccStatus}" />
                </p:commandLink>

And the dialog box is

                <p:outputPanel id="dialogPanel"
                rendered="#{not reqSearchHandler.accStatusFlag}">
                <p:dialog header="Effect Dialog" widgetVar="dlg3"
                    showEffect="bounce" hideEffect="explode" height="200">
                    <h:outputText
                        value="Account is #{searchHandler.selectedAccIns.accStatusDesc}" />
                    <h:outputText value="Do you want to continue?" />
                    <div align="left">
                        <p:commandButton value="Yes" action="accept" />
                        <p:spacer width="960" height="5" />
                        <p:commandButton value="No" action="cancel" />
                    </div>
                </p:dialog>
            </p:outputPanel>

But when I am clicking on the command link , I am getting 3 dialog boxes. Can you please tell me why it is so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:55:59+00:00Added an answer on May 25, 2026 at 5:55 am

    Somebody else just posted the same problem! 🙂

    You should use the oncomplete attribute instead of onclick of the commandButton. The click javascript event occurs before the page posts back, likely causing your dialog not to appear because of the page reloading.

    oncomplete="dlg3.show()" will display the dialog AFTER the postback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hii I want show a pop up Dialog box when i click on to
I've got a HTML link <a href=http://jquery.com>Click</a> I want to show a dialog box
I have an ImageButton which on click i show a dialog box where users
I want to show a dialog which gets its content from server dynamically using
The work flow: user click the button, a dialog box opens with a search
I want to show dialog box at directx. On full Screen, I can't see
On a menu item click, I want to pop a dialog box. private void
I want to show a dialog inside another dialog box it's working fine but
I want to show a dialog (kind of splash screen) when my application is
I want to show a dialog that will allow the user to select a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.