Re: Getting ID of an updated zone

2016-09-17 Thread Chris Poulsen
Check to see what "this" refers to in the handler? Isn't that often the
element that triggered the event?

On Sat, Sep 17, 2016 at 12:25 PM, Adam X  wrote:

> Thanks for the suggestion about t5atmosphere. I will definitely look into
> it.
>
> I do not want to send ids back to the server. I simply want my client
> side javascript get invoked after zone is updated (after zone
> javascript update executed) and I would like to receive an id of the
> zone that was just updated as a function parameter in my javascript.
>
> Adam
>
> On Sat, Sep 17, 2016 at 11:39 AM, Ido Dovrat  wrote:
> > Where do you want to pass this id? Back to the server? If so, maybe it
> > would be more efficient to log this info on the server while you are
> > rendering the new html for the updated zone, before the response is even
> > sent (instead of waiting for the zone to be updated, then sending a new
> > request to the server informing it of the update)?
> >
> > On Sat, Sep 17, 2016 at 11:17 AM, Adam X  wrote:
> >
> >> Hi,
> >>
> >> I'm trying to wrap my head around the new 5.4 JS support. I have the
> >> following module which gets invoked whenever a zone is updated,
> >> however, I have 12 zones on my page periodically updated. I don't know
> >> at runtime which zone is updated, but I need to be notified about it.
> >>
> >> So I have the following module:
> >>
> >> define(["t5/core/dom", "t5/core/events"], function(dom, events) {
> >>
> >> return function() {
> >> dom.onDocument(events.zone.didUpdate, function() {
> >> alert('how can I get ID of a zone that was updated?');
> >> });
> >> }
> >> });
> >>
> >> I have a hard time figuring out how to pass the ID of a zone that was
> >> updated.
> >>
> >> Adam
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Getting ID of an updated zone

2016-09-17 Thread Adam X
Thanks for the suggestion about t5atmosphere. I will definitely look into it.

I do not want to send ids back to the server. I simply want my client
side javascript get invoked after zone is updated (after zone
javascript update executed) and I would like to receive an id of the
zone that was just updated as a function parameter in my javascript.

Adam

On Sat, Sep 17, 2016 at 11:39 AM, Ido Dovrat  wrote:
> Where do you want to pass this id? Back to the server? If so, maybe it
> would be more efficient to log this info on the server while you are
> rendering the new html for the updated zone, before the response is even
> sent (instead of waiting for the zone to be updated, then sending a new
> request to the server informing it of the update)?
>
> On Sat, Sep 17, 2016 at 11:17 AM, Adam X  wrote:
>
>> Hi,
>>
>> I'm trying to wrap my head around the new 5.4 JS support. I have the
>> following module which gets invoked whenever a zone is updated,
>> however, I have 12 zones on my page periodically updated. I don't know
>> at runtime which zone is updated, but I need to be notified about it.
>>
>> So I have the following module:
>>
>> define(["t5/core/dom", "t5/core/events"], function(dom, events) {
>>
>> return function() {
>> dom.onDocument(events.zone.didUpdate, function() {
>> alert('how can I get ID of a zone that was updated?');
>> });
>> }
>> });
>>
>> I have a hard time figuring out how to pass the ID of a zone that was
>> updated.
>>
>> Adam
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>

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



Re: Getting ID of an updated zone

2016-09-17 Thread Ido Dovrat
Where do you want to pass this id? Back to the server? If so, maybe it
would be more efficient to log this info on the server while you are
rendering the new html for the updated zone, before the response is even
sent (instead of waiting for the zone to be updated, then sending a new
request to the server informing it of the update)?

On Sat, Sep 17, 2016 at 11:17 AM, Adam X  wrote:

> Hi,
>
> I'm trying to wrap my head around the new 5.4 JS support. I have the
> following module which gets invoked whenever a zone is updated,
> however, I have 12 zones on my page periodically updated. I don't know
> at runtime which zone is updated, but I need to be notified about it.
>
> So I have the following module:
>
> define(["t5/core/dom", "t5/core/events"], function(dom, events) {
>
> return function() {
> dom.onDocument(events.zone.didUpdate, function() {
> alert('how can I get ID of a zone that was updated?');
> });
> }
> });
>
> I have a hard time figuring out how to pass the ID of a zone that was
> updated.
>
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Getting ID of an updated zone

2016-09-17 Thread Lance Java
If you want streaming updates to a page you might be interested in
tapestry-atmosphere or tapestry-cometd rather than 12 periodic updates on a
page.

https://github.com/uklance/tapestry-atmosphere
http://t5atmosphere-lazan.rhcloud.com/

https://github.com/uklance/tapestry-cometd
http://t5cometd-lazan.rhcloud.com/

On 17 Sep 2016 9:17 a.m., "Adam X"  wrote:

> Hi,
>
> I'm trying to wrap my head around the new 5.4 JS support. I have the
> following module which gets invoked whenever a zone is updated,
> however, I have 12 zones on my page periodically updated. I don't know
> at runtime which zone is updated, but I need to be notified about it.
>
> So I have the following module:
>
> define(["t5/core/dom", "t5/core/events"], function(dom, events) {
>
> return function() {
> dom.onDocument(events.zone.didUpdate, function() {
> alert('how can I get ID of a zone that was updated?');
> });
> }
> });
>
> I have a hard time figuring out how to pass the ID of a zone that was
> updated.
>
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Getting ID of an updated zone

2016-09-17 Thread Adam X
Hi,

I'm trying to wrap my head around the new 5.4 JS support. I have the
following module which gets invoked whenever a zone is updated,
however, I have 12 zones on my page periodically updated. I don't know
at runtime which zone is updated, but I need to be notified about it.

So I have the following module:

define(["t5/core/dom", "t5/core/events"], function(dom, events) {

return function() {
dom.onDocument(events.zone.didUpdate, function() {
alert('how can I get ID of a zone that was updated?');
});
}
});

I have a hard time figuring out how to pass the ID of a zone that was updated.

Adam

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