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 8772697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:05:55+00:00 2026-06-13T18:05:55+00:00

How can I show/call a dialog programmatically and add this to stage (actual browser

  • 0

How can I show/call a dialog programmatically and add this to stage (actual browser window)?

I want to trigger a database update every 2 hours. I have done this with a TimerTask. This works fine for me, the timer task gets all the data I want from the database. Before this timer task is triggered I want to “lock” the screen for some seconds that no user (session scoped) can access the database (I also know how this will work). My problem is that I don’t know/cannot find a way to call a dialog programmatically.


Update I want to set this primefaces dialog:

Dialog dialog = new Dialog(); 
dialog.setAppendToBody(true);
dialog.setModal(true);
dialog.setVisible(true);
dialog.setWidgetVar("generatedDialog");
dialog.setId("fancyDialog");
dialog.setClosable(false);
dialog.setHeader("Getting latest information from the database");
dialog.setDynamic(true);
dialog.setResizable(false);
dialog.setDraggable(false);

How can I display it to my browser?

  • 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-06-13T18:05:56+00:00Added an answer on June 13, 2026 at 6:05 pm

    You don’t need to create a dialog programatically. What you need is Push Technlogogy, i.e. the server initiates the interaction with the clients. PrimeFaces already have this technology and ready to use for you.

    A basic case for your needs would be the PrimePush – FacesMessage:

    • User writes a notification.
    • The server gets the notification.
    • The notification is sent to the PushContext under the /notifications channel.
    • To every client that contains the /notifications channel, an action will be executed. In this case, the channel is only in the same page, and the action will be to show the notification.

    You can test this behavior by opening the same page in two different navigators and send a notification. All the pages will show the notification (and looks like what you want).

    Having this example on, the only thing you need to do will be:

    1. Set a channel on every page (this is really tedious work but it’s what you want/need) or on the master pages (in case you used the template system).
    2. Your timer has to invoke somewhat a Server request to start the notification. There’s a sample here about how to upload a file programmatically, but you only have to start the request1, no need to send any parameters.
    3. The request that the Timer invokes will add a notification to the channel.
    4. The channel will automatically fire the action and can do what you want/need. In the provided example, it shows a growl, but you can modify it to show a <p:dialog>.

    1 In order to prevent users to invoke this request for you, it would be good to set a Filter that prevents anyone except your timer to execute the request.

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

Sidebar

Related Questions

Is there a Win32 function I can call to show a Windows login dialog?
I want to show the dialog during the Receiver , i used this code
I know when you call the dialog you can use .dialog({ show: 'fade', hide:
Is there an IDE/Tool/script/something that can show call hierarchy and/or data flow in Scala+Java
I would like to know how I can show the output from this piece
I want to show a jquery dialog next to a button when its clicked.
I'm using this code sample that came from jquery-ui website to show the dialog
I want to show the progress bar during web service call. I called progress
I want to show a custom dialog in a webview app when there is
Surprisingly one can show more than one dialog at a time by putting the

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.