Tapestry 5.4 Ajax Event Handling

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Tapestry 5.4 Ajax Event Handling

Peter Skala
Hi everybody,

I am preparing the migration of two tapestry projects from 5.3.7 to 5.4. A
strong motivation for this is the fact, that die client (java script)
interface is much clearer and easier to handle and to extend in Tapestry
5.4. (Great Job guys!! Thanks!)

Nevertheless  in both of these projects I end up with modifying of one of
the tapestry own javascript modules, namely  t5-core-dom-prototype.js
(t5-core-dom.coffee in the source distribution) in the dame way, by adding
a this function to the module exports:

onElement: function( selector, events, match, handler) {
  return exports.on( selector, events, match, handler);
},

In the first project it is necessary because this function used in
tapestry internally in the normal case:

onDocument: function(events, match, handler) {
  return exports.on( document, events, match, handler);
},

does not work with Ajax requests on IE8. It may be of little concern for
the most of you, but should someone need it, this is the solution. As
selector you define the form, which triggers the Ajax request.

In the second project I incline to use the same onElement function above
from more subjective reasons. It seems to me that it increases the
reaction speed of the page and (this is really absolutely subjective)
reduces its overall complexity. The pages in this app are kind of
micro-workflows with several forms and several Ajax zones, a single
request may modify more than one zone. A zone may be modified by different
requests.

I would appreciate if someone could share her/his experience with more
complex pages (several forms and several Ajax zones) working under T 5.4
especially in regard to performance. My feeling is that the reaction time
increased in T5.4 compared with 5.3.7 and that it is the client that needs
more time to trigger the actions.

It will help me to solve my dilemma – modify an internal tapestry file for
a project? (which is not really a good practice), or accept an increase in
the reaction time?

Best regards,
Peter








---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Thiago H de Paula Figueiredo
On Wed, 06 Aug 2014 06:56:30 -0300, <[hidden email]> wrote:

> Hi everybody,

Hi!

>
> I am preparing the migration of two tapestry projects from 5.3.7 to 5.4.  
> A
> strong motivation for this is the fact, that die client (java script)
> interface is much clearer and easier to handle and to extend in Tapestry
> 5.4. (Great Job guys!! Thanks!)
>
> Nevertheless  in both of these projects I end up with modifying of one of
> the tapestry own javascript modules, namely  t5-core-dom-prototype.js
> (t5-core-dom.coffee in the source distribution) in the dame way, by  
> adding a this function to the module exports:

You don't need to do that. Just monkey-patch it. This is JavaScript, so  
all public functions are overridable. Check this:  
http://me.dt.in.th/page/JavaScript-override/.

> does not work with Ajax requests on IE8. It may be of little concern for
> the most of you, but should someone need it, this is the solution. As
> selector you define the form, which triggers the Ajax request.

Have you filed a JIRA about this?

> I would appreciate if someone could share her/his experience with more
> complex pages (several forms and several Ajax zones) working under T 5.4
> especially in regard to performance. My feeling is that the reaction time
> increased in T5.4 compared with 5.3.7 and that it is the client that  
> needs more time to trigger the actions.

Have you done any time measurements?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Peter Skala
Hi Thiago,

thanks for the useful link.
Many thanks also for the hint - I don't event have to monkey path the
t5-dom module, as the "on" method in this module is public. It is enough
to call it with the "selector" as the first parameter instead of document.

I haven't filled Jira yet. This is a new land for me. Would you do it or
do I have to do it?

I have no real measurements, I am sorry.

Peter

> On Wed, 06 Aug 2014 06:56:30 -0300, <[hidden email]> wrote:
>
>> Hi everybody,
>
> Hi!
>
>>
>> I am preparing the migration of two tapestry projects from 5.3.7 to 5.4.
>> A
>> strong motivation for this is the fact, that die client (java script)
>> interface is much clearer and easier to handle and to extend in Tapestry
>> 5.4. (Great Job guys!! Thanks!)
>>
>> Nevertheless  in both of these projects I end up with modifying of one
>> of
>> the tapestry own javascript modules, namely  t5-core-dom-prototype.js
>> (t5-core-dom.coffee in the source distribution) in the dame way, by
>> adding a this function to the module exports:
>
> You don't need to do that. Just monkey-patch it. This is JavaScript, so
> all public functions are overridable. Check this:
> http://me.dt.in.th/page/JavaScript-override/.
>
>> does not work with Ajax requests on IE8. It may be of little concern for
>> the most of you, but should someone need it, this is the solution. As
>> selector you define the form, which triggers the Ajax request.
>
> Have you filed a JIRA about this?
>
>> I would appreciate if someone could share her/his experience with more
>> complex pages (several forms and several Ajax zones) working under T 5.4
>> especially in regard to performance. My feeling is that the reaction
>> time
>> increased in T5.4 compared with 5.3.7 and that it is the client that
>> needs more time to trigger the actions.
>
> Have you done any time measurements?
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Thiago H de Paula Figueiredo
On Wed, 06 Aug 2014 10:38:40 -0300, <[hidden email]> wrote:

> Hi Thiago,

Hi!

> thanks for the useful link.
> Many thanks also for the hint - I don't event have to monkey path the
> t5-dom module, as the "on" method in this module is public. It is enough
> to call it with the "selector" as the first parameter instead of  
> document.

Nice!

> I haven't filled Jira yet. This is a new land for me. Would you do it or
> do I have to do it?

Please do it yourself, so you can receive e-mail notifications when  
anything happens in the ticket, such as comments, commits, state changes  
(closed, in progress, etc), etc. Just go to  
https://issues.apache.org/jira/browse/TAP5, create an user if you haven't  
yet and create a new ticket about this issue.

> I have no real measurements, I am sorry.

No problem. :) Time perception can be deceptive, so number are useful when  
available. I'm not sure how the round-trip time of AJAX requests and their  
processing client-side could have gotten noticeably slower from 5.3 to  
5.4, or even slower at all.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Peter Skala

>
>> Hi Thiago,
>
> Hi!
>
>> thanks for the useful link.
>> Many thanks also for the hint - I don't event have to monkey path the
>> t5-dom module, as the "on" method in this module is public. It is enough
>> to call it with the "selector" as the first parameter instead of
>> document.
>
> Nice!
>
>> I haven't filled Jira yet. This is a new land for me. Would you do it or
>> do I have to do it?
>
> Please do it yourself, so you can receive e-mail notifications when
> anything happens in the ticket, such as comments, commits, state changes
> (closed, in progress, etc), etc. Just go to
> https://issues.apache.org/jira/browse/TAP5, create an user if you haven't
> yet and create a new ticket about this issue.

I shall do it as soon as possible

>
>> I have no real measurements, I am sorry.
>
> No problem. :) Time perception can be deceptive, so number are useful when
> available. I'm not sure how the round-trip time of AJAX requests and their
> processing client-side could have gotten noticeably slower from 5.3 to
> 5.4, or even slower at all.

thanks for your experience. I will try to do some systematical
measurements of the response times on the front end and back end
separately soon, hopefully next week, and let you then know.
Peter

>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Thiago H de Paula Figueiredo
On Wed, 06 Aug 2014 12:22:24 -0300, <[hidden email]> wrote:

> I shall do it as soon as possible

Thanks in advance. :) Posting bugs is a contribution to the project. ;)

> thanks for your experience. I will try to do some systematical
> measurements of the response times on the front end and back end
> separately soon, hopefully next week, and let you then know.
> Peter

Nice! :)

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

trsvax
Are you running with jQuery or Prototype? I just found a Zone event problem
today and when I switched to jQuery it went away.


On Wed, Aug 6, 2014 at 12:49 PM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Wed, 06 Aug 2014 12:22:24 -0300, <[hidden email]> wrote:
>
>  I shall do it as soon as possible
>>
>
> Thanks in advance. :) Posting bugs is a contribution to the project. ;)
>
>
>  thanks for your experience. I will try to do some systematical
>> measurements of the response times on the front end and back end
>> separately soon, hopefully next week, and let you then know.
>> Peter
>>
>
> Nice! :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Peter Skala
I am using prototype. What kind of problem is it?

> Are you running with jQuery or Prototype? I just found a Zone event
> problem
> today and when I switched to jQuery it went away.
>
>
> On Wed, Aug 6, 2014 at 12:49 PM, Thiago H de Paula Figueiredo <
> [hidden email]> wrote:
>
>> On Wed, 06 Aug 2014 12:22:24 -0300, <[hidden email]> wrote:
>>
>>  I shall do it as soon as possible
>>>
>>
>> Thanks in advance. :) Posting bugs is a contribution to the project. ;)
>>
>>
>>  thanks for your experience. I will try to do some systematical
>>> measurements of the response times on the front end and back end
>>> separately soon, hopefully next week, and let you then know.
>>> Peter
>>>
>>
>> Nice! :)
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tapestry 5.4 Ajax Event Handling

Peter Skala
In reply to this post by Thiago H de Paula Figueiredo
homework done

> On Wed, 06 Aug 2014 10:38:40 -0300, <[hidden email]> wrote:
>
>> Hi Thiago,
>
> Hi!
>
>> thanks for the useful link.
>> Many thanks also for the hint - I don't event have to monkey path the
>> t5-dom module, as the "on" method in this module is public. It is enough
>> to call it with the "selector" as the first parameter instead of
>> document.
>
> Nice!
>
>> I haven't filled Jira yet. This is a new land for me. Would you do it or
>> do I have to do it?
>
> Please do it yourself, so you can receive e-mail notifications when
> anything happens in the ticket, such as comments, commits, state changes
> (closed, in progress, etc), etc. Just go to
> https://issues.apache.org/jira/browse/TAP5, create an user if you haven't
> yet and create a new ticket about this issue.
>
>> I have no real measurements, I am sorry.
>
> No problem. :) Time perception can be deceptive, so number are useful when
> available. I'm not sure how the round-trip time of AJAX requests and their
> processing client-side could have gotten noticeably slower from 5.3 to
> 5.4, or even slower at all.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]