Re: T5 how to execute javascript after zone update?

2009-04-20 Thread Howard Lewis Ship
There's now an event you can observe that gets triggered just after
the content of the zone is updated. The event is fired on the Zone's
div element. See the nightly docs (Zone component reference) for
details.

On Wed, Apr 15, 2009 at 1:46 AM, Hugo Palma hugo.m.pa...@gmail.com wrote:
 There was a discussion on the list recently regarding this subject (
 http://www.nabble.com/Executing-javascript-on-ajax-call-return-td22667258.html
 ).
 An issue was created for this, you can watch/vote for it here
 https://issues.apache.org/jira/browse/TAP5-624

 2009/4/14 grabarz umrzy...@gazeta.pl

 is there any way to execute custom piece of javascript after zone
 update? inside tapestry.js i found:

    loadScriptsInReply : function(reply, callback)

     * Passed the JSON content of a Tapestry partial markup response,
 extracts
     * the script and stylesheet information.  JavaScript libraries and
 stylesheets are loaded,
     * then the callback is invoked.

 and indeed it tries to evaluate passed script:

      if (reply.script) eval(reply.script);

 the question is, how to inject my javascript into reply?

 cheers,
 m.


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






-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

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



Re: T5 how to execute javascript after zone update?

2009-04-15 Thread Hugo Palma
There was a discussion on the list recently regarding this subject (
http://www.nabble.com/Executing-javascript-on-ajax-call-return-td22667258.html
).
An issue was created for this, you can watch/vote for it here
https://issues.apache.org/jira/browse/TAP5-624

2009/4/14 grabarz umrzy...@gazeta.pl

 is there any way to execute custom piece of javascript after zone
 update? inside tapestry.js i found:

loadScriptsInReply : function(reply, callback)

 * Passed the JSON content of a Tapestry partial markup response,
 extracts
 * the script and stylesheet information.  JavaScript libraries and
 stylesheets are loaded,
 * then the callback is invoked.

 and indeed it tries to evaluate passed script:

  if (reply.script) eval(reply.script);

 the question is, how to inject my javascript into reply?

 cheers,
 m.


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




T5 how to execute javascript after zone update?

2009-04-14 Thread grabarz
is there any way to execute custom piece of javascript after zone
update? inside tapestry.js i found:

loadScriptsInReply : function(reply, callback)

 * Passed the JSON content of a Tapestry partial markup response, extracts
 * the script and stylesheet information.  JavaScript libraries and 
stylesheets are loaded,
 * then the callback is invoked.

and indeed it tries to evaluate passed script:

  if (reply.script) eval(reply.script);

the question is, how to inject my javascript into reply?

cheers,
m.


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



Re: T5 how to execute javascript after zone update?

2009-04-14 Thread DH
1. If your return is Block or Zone, just put script.../script inside the 
block or zone.
2. If return is JSONObject, can do like this: 
JSONObject response = new JSONObject();
response.put(script, alert('ff');); 
return response;

Thanks,
DH


- Original Message - 
From: grabarz umrzy...@gazeta.pl
To: users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 5:37 AM
Subject: T5 how to execute javascript after zone update?


 is there any way to execute custom piece of javascript after zone
 update? inside tapestry.js i found:
 
loadScriptsInReply : function(reply, callback)
 
 * Passed the JSON content of a Tapestry partial markup response, extracts
 * the script and stylesheet information.  JavaScript libraries and 
 stylesheets are loaded,
 * then the callback is invoked.
 
 and indeed it tries to evaluate passed script:
 
  if (reply.script) eval(reply.script);
 
 the question is, how to inject my javascript into reply?
 
 cheers,
 m.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


Re: T5 how to execute javascript after zone update?

2009-04-14 Thread Fernando Padilla
You use the normal RenderSupport.addScript(..) method.  And tapestry 
adds it to the json response, and it gets executed by loadScriptsInReply...


DH wrote:

1. If your return is Block or Zone, just put script.../script inside the 
block or zone.
2. If return is JSONObject, can do like this: 
JSONObject response = new JSONObject();
response.put(script, alert('ff');); 
return response;


Thanks,
DH


- Original Message - 
From: grabarz umrzy...@gazeta.pl

To: users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 5:37 AM
Subject: T5 how to execute javascript after zone update?



is there any way to execute custom piece of javascript after zone
update? inside tapestry.js i found:

   loadScriptsInReply : function(reply, callback)

* Passed the JSON content of a Tapestry partial markup response, extracts
* the script and stylesheet information.  JavaScript libraries and 
stylesheets are loaded,
* then the callback is invoked.

and indeed it tries to evaluate passed script:

 if (reply.script) eval(reply.script);

the question is, how to inject my javascript into reply?

cheers,
m.


-
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: T5 how to execute javascript after zone update?

2009-04-14 Thread DH
I remember @Inject RenderSupport is not available in ajax action request even 
though in latest snapshot,  I just tried several days ago and got error. 

Thanks
DH


- Original Message - 
From: Fernando Padilla 
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 10:16 AM
Subject: Re: T5 how to execute javascript after zone update?


 You use the normal RenderSupport.addScript(..) method.  And tapestry 
 adds it to the json response, and it gets executed by loadScriptsInReply...
 
 DH wrote:
 1. If your return is Block or Zone, just put script.../script inside the 
 block or zone.
 2. If return is JSONObject, can do like this: 
 JSONObject response = new JSONObject();
 response.put(script, alert('ff');); 
 return response;
 
 Thanks,
 DH
 
 
 - Original Message - 
 From: grabarz umrzy...@gazeta.pl
 To: users@tapestry.apache.org
 Sent: Wednesday, April 15, 2009 5:37 AM
 Subject: T5 how to execute javascript after zone update?
 
 
 is there any way to execute custom piece of javascript after zone
 update? inside tapestry.js i found:

loadScriptsInReply : function(reply, callback)

 * Passed the JSON content of a Tapestry partial markup response, 
 extracts
 * the script and stylesheet information.  JavaScript libraries and 
 stylesheets are loaded,
 * then the callback is invoked.

 and indeed it tries to evaluate passed script:

  if (reply.script) eval(reply.script);

 the question is, how to inject my javascript into reply?

 cheers,
 m.


 -
 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: T5 how to execute javascript after zone update?

2009-04-14 Thread Fernando Padilla

did you try @Environmental?


DH wrote:
I remember @Inject RenderSupport is not available in ajax action request even though in latest snapshot,  I just tried several days ago and got error. 


Thanks
DH


- Original Message - 
From: Fernando Padilla 
To: Tapestry users users@tapestry.apache.org

Sent: Wednesday, April 15, 2009 10:16 AM
Subject: Re: T5 how to execute javascript after zone update?


You use the normal RenderSupport.addScript(..) method.  And tapestry 
adds it to the json response, and it gets executed by loadScriptsInReply...


DH wrote:

1. If your return is Block or Zone, just put script.../script inside the 
block or zone.
2. If return is JSONObject, can do like this: 
JSONObject response = new JSONObject();
response.put(script, alert('ff');); 
return response;


Thanks,
DH


- Original Message - 
From: grabarz umrzy...@gazeta.pl

To: users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 5:37 AM
Subject: T5 how to execute javascript after zone update?



is there any way to execute custom piece of javascript after zone
update? inside tapestry.js i found:

   loadScriptsInReply : function(reply, callback)

* Passed the JSON content of a Tapestry partial markup response, extracts
* the script and stylesheet information.  JavaScript libraries and 
stylesheets are loaded,
* then the callback is invoked.

and indeed it tries to evaluate passed script:

 if (reply.script) eval(reply.script);

the question is, how to inject my javascript into reply?

cheers,
m.


-
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




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



Re: T5 how to execute javascript after zone update?

2009-04-14 Thread DH
Not yet, thanks for remind, I will try soon. If so, cool.

Thanks,
DH


- Original Message - 
From: Fernando Padilla f...@alum.mit.edu
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, April 15, 2009 11:19 AM
Subject: Re: T5 how to execute javascript after zone update?


 did you try @Environmental?
 
 
 DH wrote:
 I remember @Inject RenderSupport is not available in ajax action request 
 even though in latest snapshot,  I just tried several days ago and got 
 error. 
 
 Thanks
 DH
 
 
 - Original Message - 
 From: Fernando Padilla 
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, April 15, 2009 10:16 AM
 Subject: Re: T5 how to execute javascript after zone update?
 
 
 You use the normal RenderSupport.addScript(..) method.  And tapestry 
 adds it to the json response, and it gets executed by loadScriptsInReply...

 DH wrote:
 1. If your return is Block or Zone, just put script.../script inside 
 the block or zone.
 2. If return is JSONObject, can do like this: 
 JSONObject response = new JSONObject();
 response.put(script, alert('ff');); 
 return response;

 Thanks,
 DH


 - Original Message - 
 From: grabarz umrzy...@gazeta.pl
 To: users@tapestry.apache.org
 Sent: Wednesday, April 15, 2009 5:37 AM
 Subject: T5 how to execute javascript after zone update?


 is there any way to execute custom piece of javascript after zone
 update? inside tapestry.js i found:

loadScriptsInReply : function(reply, callback)

 * Passed the JSON content of a Tapestry partial markup response, 
 extracts
 * the script and stylesheet information.  JavaScript libraries and 
 stylesheets are loaded,
 * then the callback is invoked.

 and indeed it tries to evaluate passed script:

  if (reply.script) eval(reply.script);

 the question is, how to inject my javascript into reply?

 cheers,
 m.


 -
 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


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