Primefaces Loading Component

UI Components for JSF
gcameo
Posts: 63
Joined: 02 Mar 2011, 07:38

02 Apr 2011, 13:22

Hi all,

Is there a primefaces loading component, that temprarily displays whiles an ajax request is being made and hides after the request completes or is it possible to simulate such an effect using any of the current components?
Primefaces version: 3.0-SNAPSHOT

JSF implementation: Mojarra 2.0.4

Server: Glassfish 3.1-beta

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Apr 2011, 14:05


gcameo
Posts: 63
Joined: 02 Mar 2011, 07:38

02 Apr 2011, 14:56

wow, perfect! Thanks
Primefaces version: 3.0-SNAPSHOT

JSF implementation: Mojarra 2.0.4

Server: Glassfish 3.1-beta

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Apr 2011, 16:20

Glad to help.

ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

19 Jul 2012, 16:50

Hi,

I need to load 100 charts and loading each chart takes different times.
is there any way of showing a loading Gif per chart while loading them?
After loading of a chart is completed, its loading Gif will disappear.

is it possible to do it with an easy way.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

19 Jul 2012, 16:51

By the way charts are dynamic primefaces linecharts (jqplot).

-- thanks in advance.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

19 Jul 2012, 17:55

I was going to post something about thinking for others however I refrained.

AJAX Status does not count when loading a page, it only works when an AJAX request is in progress so they don't work as page loading indicators.
However, you do have an indicator for each chart, the chart itself.
Other than that you can also do clever stuff with JavaScript that sets up a model dialog box in which an animations runs and javascript called after each graph tag which changes the animation accordingly.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

19 Jul 2012, 18:59

Thanks for replying andyba,

I think that an ajaxStatus like indicator working for loading of components(chart etc) would be worthy and appreciated.
With Javascript it is not easy to manage dynamic loading charts.

Would you please offer a pseudo code to me, if it is possible.
I am trying to load a dashboard page including a lot of charts each one to be rendered separately from each other and each one should have
it's own loading indicator. in backing bean side it seems i need to use concurrent threads retrieving data from Database as well which is another tricky part to me...

regards.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

20 Jul 2012, 11:18

ryildiz wrote:Thanks for replying andyba,

I think that an ajaxStatus like indicator working for loading of components(chart etc) would be worthy and appreciated.
With Javascript it is not easy to manage dynamic loading charts.

Would you please offer a pseudo code to me, if it is possible.
I am trying to load a dashboard page including a lot of charts each one to be rendered separately from each other and each one should have
it's own loading indicator. in backing bean side it seems i need to use concurrent threads retrieving data from Database as well which is another tricky part to me...

regards.
Without knowing exactly how you want to do things any psuedocode I provide won't really help you.
I would certainly reconsider loading so many charts at once though, split them up into tabs where the tabs are dynamically loaded.
You could try having an image which overlays each chart component which you simply rendered="false" via RequestContext.update in each chart data accessor.

You are not going to gain anything by use concurrency here unless you attempt to prepare each chart model at the beginning of the request: this will almost certainly kill your server when you have more than a few concurrent requests.

There are several things that need to be considered or reconsidered.

1- You have ~100 charts that need to be displayed in a dashboard. Don't even attempt to load them into one page, use a Tab or Accordion and load each view dynamically
2- Your chart models are taking a long time to initialise. Optimise the initialisation (run aggregation at discrete invervals via a @TimerService and use this data to initialise your charts as an example)
3- You can setup a status for each chart and create a widgetVar reference which you can manipulate via RequestContext.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

ryildiz
Posts: 33
Joined: 19 Jul 2012, 16:43
Location: Kurtkoy/Istanbul
Contact:

20 Jul 2012, 13:18

Thanks a lot for your suggestion andyba.
i'll try to do so.
Ramazan YILDIZ
Senior Software Developer Engineer
Netas RnD
ramazangsu[at]gmail.com

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests