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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:29:22+00:00 2026-06-05T06:29:22+00:00

Here’s my scenario: I’m using JSF. I have a page that refreshes every 5

  • 0

Here’s my scenario:

I’m using JSF.

  1. I have a page that refreshes every 5 seconds (but the user doesn’t notice it because everything is ajaxified)
  2. I’d like to have a modal window that shows a list of things to the user when the user clicks something (e.g., a button). So every time the user clicks that button, the modal appears with the up to date list.

Right now I have the following: the modal with the a property loaded to it. This property loads stuff from DB and returns the list to the JSF page.

The main problem is since the page refreshes every 5 seconds, this property is called every 5 seconds (i.e., a request to DB).

Summarizing: I’d like to have a modal that loads a list every time the user clicks a button, inside a page that refreshes (ajaxified) every 5 seconds.

What’s the right way of doing such things? Pointers to good tutorials are good answers, I don’t need code, but rather understand the best practice.

Thanks.

  • 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-05T06:29:23+00:00Added an answer on June 5, 2026 at 6:29 am

    I’d fetch the list from the database whenever the user clicks the button, and put it into a property of a bean that survives the current request (scope = session, view, conversation, or whatever), then bind that property with the EL expression.

    To fetch the list upon clicking the button, have the button trigger an ajax request that rerenders the content of the panel, and makes the panel visible upon completion of the ajax request. You haven’t said what ajax or component library you are using; with Richfaces, it’s something like:

    <a4j:commandButton 
        action="#{mybean.fetchListFromDatabase}" 
        rerender="panelcontent" 
        oncomplete="Richfaces.showModalPanel('thepanel')"
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code (Say we have a single button on the page that
Here's my scenario - I have an SSIS job that depends on another prior
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Here is the problem that I am trying to solve. I have two folders
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is the issue I am having: I have a large query that needs
Here is the scenario: I'm writing an app that will watch for any changes
Here this the code that I'm using: progressFrame = (FrameLayout) findViewById(R.id.progressFrame); progressFrame.setBackgroundResource(R.drawable.startprogress); All works
Here is my problem. I have a LinearLayout that has clickable=true for an onTouch
Here is my code that I have which is pretty simple and to 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.