example JTAjaxWaitPopup

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

example JTAjaxWaitPopup

Post by LEONARDO19712 » Tue Apr 16, 2013 7:07 am

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

jomitech
Site Admin
Posts: 1954
Joined: Wed Oct 08, 2008 12:23 am

Re: example JTAjaxWaitPopup

Post by jomitech » Wed Apr 17, 2013 9:07 am

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");
Jon

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

Re: example JTAjaxWaitPopup

Post by LEONARDO19712 » Thu Apr 18, 2013 9:22 am

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
Attachments
hipnosis html5.rar
(1.56 KiB) Downloaded 683 times

jomitech
Site Admin
Posts: 1954
Joined: Wed Oct 08, 2008 12:23 am

Re: example JTAjaxWaitPopup

Post by jomitech » Mon Apr 22, 2013 8:36 am

Put that code into the OnReady JavaScript event.
Jon

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

Re: example JTAjaxWaitPopup

Post by LEONARDO19712 » Thu May 02, 2013 8:37 pm

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.
Attachments
pruebas.rar
(1.35 KiB) Downloaded 659 times

jomitech
Site Admin
Posts: 1954
Joined: Wed Oct 08, 2008 12:23 am

Re: example JTAjaxWaitPopup

Post by jomitech » Mon May 06, 2013 8:45 am

Your code is correct, if you can't see the popup, then the browser is loading the page too fast to see it.
Jon

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

Re: example JTAjaxWaitPopup

Post by LEONARDO19712 » Tue May 07, 2013 11:09 am

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

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

Re: example JTAjaxWaitPopup

Post by LEONARDO19712 » Tue May 07, 2013 6:43 pm

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?
Attachments
ajax.rar
(1.04 KiB) Downloaded 647 times

jomitech
Site Admin
Posts: 1954
Joined: Wed Oct 08, 2008 12:23 am

Re: example JTAjaxWaitPopup

Post by jomitech » Wed May 08, 2013 8:28 am

Are you trying to show this message when the page is loading, or when an Ajax request is submitted?
Jon

LEONARDO19712
Posts: 84
Joined: Sun Mar 17, 2013 1:15 pm

Re: example JTAjaxWaitPopup

Post by LEONARDO19712 » Wed May 08, 2013 4:05 pm

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

Post Reply