You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Nagl <mn...@mtbiker.sk> on 2014/03/20 09:45:59 UTC

T5.4 - spinner zone overlay

Hi all,

I am trying to implement a "loading" indicator for zone updates in Tapestry
5.4. Something like this, but for T5.4:
http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/spinner-zone-overlay.js

In T5.3 you can use:
$(document.body).on(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, addZoneOverlay)

Is there a corresponding event in T5.4? I only found "events.zone.update",
which is triggered when zone is being updated.

Has anybody tried to implement this in T5.4?

Thanks
Martin

Re: T5.4 - spinner zone overlay

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Please create an issue on google code.  Thanks. 

> On Mar 21, 2014, at 9:48 AM, Martin Nagl <mn...@mtbiker.sk> wrote:
> 
> I found the solution. The event I was looking for is "events.zone.refresh".
> See where it is triggered in module "t5/core/zone".
> 
> @Lenny Primak
> Thanx for pointing out the T5.4 branch of Flowlogix library, I didn't
> notice it at first. Your mixin "ZoneLoadingSpinner" is exactly what I need,
> but there is one bug you may want to fix: in file spinner-zone-overlay.js
> on line 35 you need to change "events.zone.willUpdate" to
> "events.zone.refresh".
> With this fix, the mixin adds a spinner overlay for all of these cases:
> - Zone update triggered by actionLink / eventLink
> - Zone update triggered by form submit
> - Grid inplace update after click on paging link
> - Grid inplace update after click on sorting link
> - (I didn't test other cases)
> 
> Thanx for sharing your code :)
> Martin
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> On Thu, Mar 20, 2014 at 1:28 PM, Martin Nagl <mn...@mtbiker.sk> wrote:
>> 
>> In T5.4, the event "t5:zone:did-update" fires only after zone has been
>> updated, which is too late to add overlay to the zone.
>> 
>> I need to add the zone overlay just after user clicks on a ajax-enabled
>> EventLink / ActionLink (including paging and sorting links in Grid), or
>> just after user submits an ajax-enabled Form - before server starts
>> processing the request (which may take a few seconds).
>> 
>> In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which was
>> being fired before request was sent to server, so it was suitable for this
>> case. In T5.4, looking at module "t5/core/events" I found no event which
>> would fire before an ajax request for zone update is sent to server.
>> 
>> Maybe a different approach is needed?
>> 
>> 
>> 
>> 

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


Re: T5.4 - spinner zone overlay

Posted by Martin Nagl <mn...@mtbiker.sk>.
I found the solution. The event I was looking for is "events.zone.refresh".
See where it is triggered in module "t5/core/zone".

@Lenny Primak
Thanx for pointing out the T5.4 branch of Flowlogix library, I didn't
notice it at first. Your mixin "ZoneLoadingSpinner" is exactly what I need,
but there is one bug you may want to fix: in file spinner-zone-overlay.js
on line 35 you need to change "events.zone.willUpdate" to
"events.zone.refresh".
With this fix, the mixin adds a spinner overlay for all of these cases:
- Zone update triggered by actionLink / eventLink
- Zone update triggered by form submit
- Grid inplace update after click on paging link
- Grid inplace update after click on sorting link
- (I didn't test other cases)

Thanx for sharing your code :)
Martin











On Thu, Mar 20, 2014 at 1:28 PM, Martin Nagl <mn...@mtbiker.sk> wrote:

> In T5.4, the event "t5:zone:did-update" fires only after zone has been
> updated, which is too late to add overlay to the zone.
>
> I need to add the zone overlay just after user clicks on a ajax-enabled
> EventLink / ActionLink (including paging and sorting links in Grid), or
> just after user submits an ajax-enabled Form - before server starts
> processing the request (which may take a few seconds).
>
> In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which was
> being fired before request was sent to server, so it was suitable for this
> case. In T5.4, looking at module "t5/core/events" I found no event which
> would fire before an ajax request for zone update is sent to server.
>
> Maybe a different approach is needed?
>
>
>
>

Re: T5.4 - spinner zone overlay

Posted by Chris Poulsen <ma...@nesluop.dk>.
Yes, one can hook into the global listeners ( there is a data-ajax-active="
true/false" on <BODY> as well, guess that also works ), but it is still not
possible to figure out which zones that will be updated, if the spinner
should go into the actual zones... a "global" spinner should be doable
though.


On Thu, Mar 20, 2014 at 4:31 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Thu, 20 Mar 2014 10:08:01 -0300, Chris Poulsen <ma...@nesluop.dk>
> wrote:
>
>  Btw. I do not think that you can get the zone-spinner to work in all
>> cases... It is possible to update zones programmatically, so you may not
>> even know which zones that are to be updated until the ajax call returns.
>>
>
> Both Protype and jQuery have global AJAX request listeners, so they may be
> the solution here.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5.4 - spinner zone overlay

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 20 Mar 2014 10:08:01 -0300, Chris Poulsen <ma...@nesluop.dk>  
wrote:

> Btw. I do not think that you can get the zone-spinner to work in all
> cases... It is possible to update zones programmatically, so you may not
> even know which zones that are to be updated until the ajax call returns.

Both Protype and jQuery have global AJAX request listeners, so they may be  
the solution here.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: T5.4 - spinner zone overlay

Posted by Chris Poulsen <ma...@nesluop.dk>.
Btw. I do not think that you can get the zone-spinner to work in all
cases... It is possible to update zones programmatically, so you may not
even know which zones that are to be updated until the ajax call returns.


On Thu, Mar 20, 2014 at 1:40 PM, Chris Poulsen <ma...@nesluop.dk>wrote:

> Did you try the "willUpdate" event?  (
> http://tapestry.apache.org/5.4/coffeescript/events.html#section-16 )
>
>
> On Thu, Mar 20, 2014 at 1:28 PM, Martin Nagl <mn...@mtbiker.sk> wrote:
>
>> In T5.4, the event "t5:zone:did-update" fires only after zone has been
>> updated, which is too late to add overlay to the zone.
>>
>> I need to add the zone overlay just after user clicks on a ajax-enabled
>> EventLink / ActionLink (including paging and sorting links in Grid), or
>> just after user submits an ajax-enabled Form - before server starts
>> processing the request (which may take a few seconds).
>>
>> In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which was
>> being fired before request was sent to server, so it was suitable for this
>> case. In T5.4, looking at module "t5/core/events" I found no event which
>> would fire before an ajax request for zone update is sent to server.
>>
>> Maybe a different approach is needed?
>>
>
>

Re: T5.4 - spinner zone overlay

Posted by Chris Poulsen <ma...@nesluop.dk>.
Did you try the "willUpdate" event?  (
http://tapestry.apache.org/5.4/coffeescript/events.html#section-16 )


On Thu, Mar 20, 2014 at 1:28 PM, Martin Nagl <mn...@mtbiker.sk> wrote:

> In T5.4, the event "t5:zone:did-update" fires only after zone has been
> updated, which is too late to add overlay to the zone.
>
> I need to add the zone overlay just after user clicks on a ajax-enabled
> EventLink / ActionLink (including paging and sorting links in Grid), or
> just after user submits an ajax-enabled Form - before server starts
> processing the request (which may take a few seconds).
>
> In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which was
> being fired before request was sent to server, so it was suitable for this
> case. In T5.4, looking at module "t5/core/events" I found no event which
> would fire before an ajax request for zone update is sent to server.
>
> Maybe a different approach is needed?
>

Re: T5.4 - spinner zone overlay

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
I think you already answered your own question in your first message:  
"events.zone.update".

On Thu, 20 Mar 2014 09:28:13 -0300, Martin Nagl <mn...@mtbiker.sk> wrote:

> In T5.4, the event "t5:zone:did-update" fires only after zone has been
> updated, which is too late to add overlay to the zone.
>
> I need to add the zone overlay just after user clicks on a ajax-enabled
> EventLink / ActionLink (including paging and sorting links in Grid), or
> just after user submits an ajax-enabled Form - before server starts
> processing the request (which may take a few seconds).
>
> In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which  
> was
> being fired before request was sent to server, so it was suitable for  
> this
> case. In T5.4, looking at module "t5/core/events" I found no event which
> would fire before an ajax request for zone update is sent to server.
>
> Maybe a different approach is needed?


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: T5.4 - spinner zone overlay

Posted by Martin Nagl <mn...@mtbiker.sk>.
In T5.4, the event "t5:zone:did-update" fires only after zone has been
updated, which is too late to add overlay to the zone.

I need to add the zone overlay just after user clicks on a ajax-enabled
EventLink / ActionLink (including paging and sorting links in Grid), or
just after user submits an ajax-enabled Form - before server starts
processing the request (which may take a few seconds).

In T5.3, one could attach to Tapestry.TRIGGER_ZONE_UPDATE_EVENT, which was
being fired before request was sent to server, so it was suitable for this
case. In T5.4, looking at module "t5/core/events" I found no event which
would fire before an ajax request for zone update is sent to server.

Maybe a different approach is needed?

Re: T5.4 - spinner zone overlay

Posted by Matthias <th...@gmail.com>.
You can try the following: $("#zone").on("t5:zone:did-update", 
addZoneOverlay);

On 20.03.2014 09:45, Martin Nagl wrote:
> Hi all,
>
> I am trying to implement a "loading" indicator for zone updates in Tapestry
> 5.4. Something like this, but for T5.4:
> http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/spinner-zone-overlay.js
>
> In T5.3 you can use:
> $(document.body).on(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, addZoneOverlay)
>
> Is there a corresponding event in T5.4? I only found "events.zone.update",
> which is triggered when zone is being updated.
>
> Has anybody tried to implement this in T5.4?
>
> Thanks
> Martin
>


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


Re: T5.4 - spinner zone overlay

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Hi,

Flowlogix 1.2.x does not support Tapestry 5.4,
Flowlogix 1.4-SNAPSHOT supports Tapestry 5.4-JQuery combination.

There is also tapestry-5.4 tag

On Mar 20, 2014, at 4:45 AM, Martin Nagl wrote:

> Hi all,
> 
> I am trying to implement a "loading" indicator for zone updates in Tapestry
> 5.4. Something like this, but for T5.4:
> http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/spinner-zone-overlay.js
> 
> In T5.3 you can use:
> $(document.body).on(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, addZoneOverlay)
> 
> Is there a corresponding event in T5.4? I only found "events.zone.update",
> which is triggered when zone is being updated.
> 
> Has anybody tried to implement this in T5.4?
> 
> Thanks
> Martin


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