You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship" <hl...@attbi.com> on 2003/04/25 03:48:23 UTC
New stuff!
Did a big rework of how script specifications work with the Body component
to generate dynamic JavaScript.
The Body component now implements an interface, IScriptProcessor, which
allows the executing script token objects to talk directly to the Body
component.
I threw out the old DOM-based parser, and wrote a new one, based on SAX.
It's actually a lot like Jakarta Digester, but simpler (and less powerful),
but doesn't prevent you from processing a markup document (Digester makes it
impossible to properly handle intermixed text and elements ... you just see
the text concatted together with no clue where the element were). It's
probably faster, fewer loc, and easier to extend.
There's now a 1.3 DTD for script specification with two new features:
<let key="frob" unique="yes">bar</let>
The base name, "bar", is passed through a method on Body to ensure it is
unique; same code that Form uses to make unique form element ids. This
means that a script can, on its own, generate unique ids when it is used
repeatedly on the same page.
<unique tag="foo.bar.baz"> ... </unique>
The content of a <unique> is only rendered once per page render. You supply
a unique tag. This is good for one-time initialization of scripts that may
also be repeatedly executed on the same page. An old workaround was to put
the block in an external script file and use <include-script> ... this
allows you to accomplish the same thing, in line.
Can anyone think of anything else needed in a script specification?
In other news ...
Per Norrman contributed a vastly improved DatePicker ... fancy stuff! Works
better in IE and Moz.
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry