You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mateen <ma...@gmail.com> on 2012/12/27 10:40:25 UTC

AJAX Throbber

Hi,

I looking to implement a AJAX Throbber for all ajax calls. This is my java
script function. 

Tapestry.onDOMLoaded(function() { 
    function addAjaxOverlay(event, element) {
        var mgr = Tapestry.findZoneManager(element); 
        var zone = mgr && mgr.element; 
        if (!zone) { 
            return; 
        } 
        var $zone = $(zone); 
        $zone.prepend("<div class='zone-ajax-overlay'/>"); 
        var overlay = $zone.children(":first"); 
        overlay.width($zone.width()).height($zone.height()); 
    } 
  
    $(document.body).bind(Tapestry.FORM_PROCESS_SUBMIT_EVENT,
addAjaxOverlay); 
    $(document.body).bind(Tapestry.TRIGGER_ZONE_UPDATE_EVENT,
addAjaxOverlay); 
});


Show Pending 


Now when i include the above js in my page, i get a "Page must be specified
before initializing for partial page render."


Here is my the code called for the click event

ajaxResponseRenderer.addRender( "searchTransactionZone",
                searchTransactionZone.getBody( ) ).addRender(
                "pendingTransactionsZone",
                pendingTransactionsZone.getBody( )).addRender(
"processedTransactionsZone", processedTransactionsZone.getBody( ));

this is the only code that is called. the return type of the function is
null. Without including the JS my page works fine. Only after this JS does
my application crash when doing a AJAX call. 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/AJAX-Throbber-tp5718999.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: AJAX Throbber

Posted by Rural Hunter <ru...@gmail.com>.
Nice!

于 2012/12/30 22:12, Geoff Callender 写道:
> In case it helps, here's a working example.
>
> 	http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/loadingspinner
>
> Cheers,
>
> Geoff
>
> On 27/12/2012, at 8:40 PM, mateen wrote:
>
>> Hi,
>>
>> I looking to implement a AJAX Throbber for all ajax calls. This is my java
>> script function.
>>
>> Tapestry.onDOMLoaded(function() {
>>     function addAjaxOverlay(event, element) {
>>         var mgr = Tapestry.findZoneManager(element);
>>         var zone = mgr && mgr.element;
>>         if (!zone) {
>>             return;
>>         }
>>         var $zone = $(zone);
>>         $zone.prepend("<div class='zone-ajax-overlay'/>");
>>         var overlay = $zone.children(":first");
>>         overlay.width($zone.width()).height($zone.height());
>>     }
>>
>>     $(document.body).bind(Tapestry.FORM_PROCESS_SUBMIT_EVENT,
>> addAjaxOverlay);
>>     $(document.body).bind(Tapestry.TRIGGER_ZONE_UPDATE_EVENT,
>> addAjaxOverlay);
>> });
>>
>>
>> Show Pending
>>
>>
>> Now when i include the above js in my page, i get a "Page must be specified
>> before initializing for partial page render."
>>
>>
>> Here is my the code called for the click event
>>
>> ajaxResponseRenderer.addRender( "searchTransactionZone",
>>                 searchTransactionZone.getBody( ) ).addRender(
>>                 "pendingTransactionsZone",
>>                 pendingTransactionsZone.getBody( )).addRender(
>> "processedTransactionsZone", processedTransactionsZone.getBody( ));
>>
>> this is the only code that is called. the return type of the function is
>> null. Without including the JS my page works fine. Only after this JS does
>> my application crash when doing a AJAX call.
>>
>>
>>
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/AJAX-Throbber-tp5718999.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: AJAX Throbber

Posted by Geoff Callender <ge...@gmail.com>.
In case it helps, here's a working example.

	http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/loadingspinner

Cheers,

Geoff

On 27/12/2012, at 8:40 PM, mateen wrote:

> Hi,
> 
> I looking to implement a AJAX Throbber for all ajax calls. This is my java
> script function. 
> 
> Tapestry.onDOMLoaded(function() { 
>    function addAjaxOverlay(event, element) {
>        var mgr = Tapestry.findZoneManager(element); 
>        var zone = mgr && mgr.element; 
>        if (!zone) { 
>            return; 
>        } 
>        var $zone = $(zone); 
>        $zone.prepend("<div class='zone-ajax-overlay'/>"); 
>        var overlay = $zone.children(":first"); 
>        overlay.width($zone.width()).height($zone.height()); 
>    } 
> 
>    $(document.body).bind(Tapestry.FORM_PROCESS_SUBMIT_EVENT,
> addAjaxOverlay); 
>    $(document.body).bind(Tapestry.TRIGGER_ZONE_UPDATE_EVENT,
> addAjaxOverlay); 
> });
> 
> 
> Show Pending 
> 
> 
> Now when i include the above js in my page, i get a "Page must be specified
> before initializing for partial page render."
> 
> 
> Here is my the code called for the click event
> 
> ajaxResponseRenderer.addRender( "searchTransactionZone",
>                searchTransactionZone.getBody( ) ).addRender(
>                "pendingTransactionsZone",
>                pendingTransactionsZone.getBody( )).addRender(
> "processedTransactionsZone", processedTransactionsZone.getBody( ));
> 
> this is the only code that is called. the return type of the function is
> null. Without including the JS my page works fine. Only after this JS does
> my application crash when doing a AJAX call. 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/AJAX-Throbber-tp5718999.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org