Page 1 of 2

example JTAjaxWaitPopup

Posted: Tue Apr 16, 2013 7:07 am
by LEONARDO19712
Hi Jon: please can you give me some example of how I could use JTAjaxWaitPopup, I have a website it takes a while to load and let me know if I can use this comonente to show the client that the page is loading and prevent do something about it before it is loaded, thanks

Re: example JTAjaxWaitPopup

Posted: Wed Apr 17, 2013 9:07 am
by jomitech
JTAjaxWaitPopup cannot be used for this purpose, but you might be able to do something similar using the code from the control. If you create some popup HTML at the start of the body (using OnStartBody), and hide it when the window.load event fires, it might work.

This is the code that is used by JTAjaxWaitPopup to create the popup HTML:

Code: Select all

var $div = $('<div><div id="WaitPopup" class="jtajaxwaitpopup jtfont">Please wait...</div><div id="WaitPopup_background" class="jtajaxwaitpopupbackground"></div></div>');

$(document.body).append($div);

var $p = $("#WaitPopup");

$p.css({ display: "block", visibility: "hidden" });
$p.css({
    left: (getBrowserScrollX() + (getBrowserWidth() - $p.width()) / 2),
    top: (getBrowserScrollY() + (getBrowserHeight() - $p.height()) / 2),
    display: "none",
    visibility: "visible" });

$("#WaitPopup_background").fadeIn("fast");
$p.fadeIn("fast");
Then this code will hide it:

Code: Select all

$("#WaitPopup_background").fadeOut("fast");
$("#WaitPopup").fadeOut("fast");

Re: example JTAjaxWaitPopup

Posted: Thu Apr 18, 2013 9:22 am
by LEONARDO19712
hi jon, thanks for your prompt response, but do not really understand where to place this code you tell me, I send the test file to tell me where is the code, thanks

Re: example JTAjaxWaitPopup

Posted: Mon Apr 22, 2013 8:36 am
by jomitech
Put that code into the OnReady JavaScript event.

Re: example JTAjaxWaitPopup

Posted: Thu May 02, 2013 8:37 pm
by LEONARDO19712
hi jon, sorry what I understand with this component is that I put the html code you sent me in the event onReady and hide that handles the onload event of the form but I do not funiona, you can see my code to see is wrong, or I'm definitely doing it all wrong, do not understand how this component. Thank you.

Re: example JTAjaxWaitPopup

Posted: Mon May 06, 2013 8:45 am
by jomitech
Your code is correct, if you can't see the popup, then the browser is loading the page too fast to see it.

Re: example JTAjaxWaitPopup

Posted: Tue May 07, 2013 11:09 am
by LEONARDO19712
hi jon, sorry for the inconvenience, but I am very interested this component, if you look at the file you send Colco one sleep (10), to give you time to show the popup with ajax, but does not show it, you tell me that the code is fine but I tried it the way it is with many databases storing data at a time and never displays the popup, I think something is wrong with the code you send, can you please review it or give me an example of how it works this component, thanks

Re: example JTAjaxWaitPopup

Posted: Tue May 07, 2013 6:43 pm
by LEONARDO19712
hi jon, I tested the code you attached delphi for php and working properly but not in html5 builder, you have an example of this with html5?

Re: example JTAjaxWaitPopup

Posted: Wed May 08, 2013 8:28 am
by jomitech
Are you trying to show this message when the page is loading, or when an Ajax request is submitted?

Re: example JTAjaxWaitPopup

Posted: Wed May 08, 2013 4:05 pm
by LEONARDO19712
where an ajax request when the page is loaded stay solved with the code above, but trying to display an ajax request, I have not worked