I have the zone render a block (using t:delegate), which contains a
script block. This works for me, at least. I use it to re-initialize a
drag & drop sortable list.
Norman Franke
Answering Service for Directors, Inc.
www.myasd.com
On Feb 4, 2010, at 5:46 PM, Benny Law wrote:
Hi everyone,
I have a zone that contains some *dynamic* JavaScript that sets a
global
JavaScript object. However, Tapestry seems to be dropping the
<script> block
from the zone when it renders. I also tried to use
RenderSupport.addScript()
in the action link event handler that updates the zone, but got the
error
"No object of type org.apache.tapestry5.RenderSupport is available
from the
Environment". My questions are:
(1) Why does Tapestry not allow embedded <script>? I can't put the
script in
a file since it contains expansions ( e.g. location.name = "$
{location.name}";
)
(2) What is the proper way to include dynamic JavaScript in zones?
Thanks in advance,
Benny