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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:58:53+00:00 2026-06-17T04:58:53+00:00

It is simple idea to resolve, however I’ve never done it before and need

  • 0

It is simple idea to resolve, however I’ve never done it before and need an advice.
I use Spring, Spring Webflow and JSF with Primefaces.

I use external webservices to fetch some data in table. Sometimes it is working slower than the website call and I want to avoid ‘waiting’ for load.
My idea (it is nothing new) is to load the page with all the static (or local-server) content and then call for the external webservice to fetch the data. Than display it when it’s finished.

So far it looks like this:

website:

<p:dataTable id="table" var="item" value="#{lastfm.topArtists}">
                    <p:column headerText="Model" sortBy="#{item.name}">
                        <h:outputText value="#{item.name}" />
                    </p:column>
</p:dataTable>

and the Bean itself its just:

private List<Artist> topArtists = new ArrayList<Artist>();
public void init(String u) {
    topArtists = (List<Artist>) User.getTopArtists(u, StaticContent.api_key);
}

User – is the Webservice API.

ATM init loads on-render of the website but I want to avoid it, call it in some way after page load, and display on success.

I assume it could be some javascript function with jquery, using
onDocumentReady() and onSuccess for ajax, but I really have no idea how to connect it.

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-17T04:58:54+00:00Added an answer on June 17, 2026 at 4:58 am

    Polling component of prime faces might help you achieve this.

    http://www.primefaces.org/showcase-labs/ui/poll.jsf

    <h:form id="form">  
    <p:poll interval="3"   
            listener="#{lastfm.topArtistsRetrieved}" update="table" />  
    
    <p:dataTable id="table" var="item" value="#{lastfm.topArtists}">
                    <p:column headerText="Model" sortBy="#{item.name}">
                        <h:outputText value="#{item.name}" />
                    </p:column>
    </p:dataTable>
    </h:form>
    

    I assume that User.getTopArists will inform you when it is finished. Basically you need a flag which indicates whether your process is ended or not. And through prime faces polling you should check whether the flag is raised or not and through ajax update you should print the results when they are ready. You might even show the progress of the process through this flow.

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

Sidebar

Related Questions

How to use simple TCP/IP sockets connections over/with Net.TCP WCF binding? Idea is –
The code pasted below is a simple JSF program, with an idea of having
I've never had to mess with my PATH before, but it seems simple enough.
The idea is simple. Make a struct for Departments of a store, give it
OK, the idea is simple. Every wordpress site is uses categories and tags taxonomies
The idea is to write a simple bookmarklet. If the question is a possible
I have no idea how to do this simple task. LightSwitch's Solution Explorer is
I have a simple task to do using PHP dealing with pagination. The idea
a possibly simple problem, but weird why I have no idea how to do
i am designing a simple project based to do list. the idea is to

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.