0

My scenario is the following:

I have a jsp page which calls through a function "window.open" an xhtml page that retrieve some data. As the query to DDBB takes a little bit, I would like to add to the xhtml page (which is actually void until data is loaded) some kind of message like "Loading data".

I like how Primefaces blockUI component works for same page when you click on a button but in my case I don't have any... the xhtml page it's just for showing some details from DDBB.

Do you have any idea about how can I do it? I was thinking that Primefaces has for sure some easy way to do it but I cannot find it :-P

Thanks in advance to you all!

All my best,

Carlos

Shahzad Barkati
  • 2,532
  • 6
  • 25
  • 33
CarlosLeo
  • 123
  • 2
  • 10
  • Pf Progress Bar can be a solution of your problem but it would call when some ajax request will happen http://www.primefaces.org/showcase/ui/misc/progressBar.xhtml .From JS how could you call that you have to check. – Subodh Joshi Dec 16 '15 at 11:39
  • I see nothing PF related or even JSF related in your question. Hence I think http://stackoverflow.com/questions/1853662/how-to-show-page-loading-div-until-the-page-has-finished-loading is a duplicate – Kukeltje Dec 16 '15 at 13:08

1 Answers1

0

One example is here,we generally show a progress image for any ajax request and code be like this

<p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()" />
<p:dialog id="progressImage" widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
 <p:graphicImage value="../resources/images/spin-loader.gif" />
</p:dialog>

Now same think you can call from Javascript function as well

function callProgessBar() {

         PF('statusDialog').show();
}
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • Hello @Subodh Joshi I think this requires a button who call the dialog... I was thinking more something like: [http://stackoverflow.com/questions/1435015/how-can-i-make-the-browser-wait-to-display-the-page-until-its-fully-loaded] but for primefaces. I want to show a message or something until the page its fully loaded – CarlosLeo Jan 28 '16 at 12:04
  • How you calling Window.open same way you can call Javascript method as well. – Subodh Joshi Jan 28 '16 at 13:05