Preston CRAWFORD wrote:
> I agree that the community is great and that the idea of Tapestry is
> great. But often times you just need to get stuff done. And right now we
> can't figure out how to get an include into a page (like you'd do with a
> SSI in JSP) where any code gets pre-processed just like the rest of the
> page. And we can't figure out how to restart the Tapestry engine in
> order to see changes to the spec and template files quickly.

Q: Have you tried starting tomcat, or your tomcat-plugin, or jetty, or
resin, or whatever other servlet container you use with the
-Dorg.apache.tapestry.disable-caching=true option? If what you want is
to be able to see template/spec changes immediately, this will do the trick.

Regarding preprocessing: as Kevin pointed out... what is it,
specifically, that you are trying to accomplish? In what manner should
the stuff be "processed"? And does the "included" file need to be chosen
dynamically? Generally speaking, in tapestry, rather than having a
single page and including content, you write a border component, which
is included on the content pages. But, if what you want is to
dynamically include blocks of html which are processed by tapestry, then
you really need to look at block/renderblock.

As an example, suppose you had a page with an area for "properties". The
"properties" page/content to be used depends on what type of object is
being edited by the page. You need the properties portion to be
fully-functional "tapestry" stuff, but the properties of the various
objects are so different as to render making a single component to
handle all of them difficult, messy, etc.  So, you might do something
like define a "getPropertiesPageName" method in each of the object-types
to edit. This returns the name of a page to edit. Additionally, you
could define a "getPropertiesBlockName" method, which gets the name of
the block to edit. Then, in the java class of the page to edit, you can
do something like:
public IComponent getBlock() {
   IPage page =
getRequestCycle().getPage(getObject().getPropertiesPageName());
   return page.getComponent(getObject().getPropertiesBlockName());
}
And in the html file, you could then do:

<div jwcid="@RenderBlock" block="ognl:block"/>

voila... you've just included arbitrary content.
There is a caveat to this approach. Since "activate"
is never called on the page with the block, methods like
"pageBeginRender", "pageValidate", etc. are /not/ called by tapestry.
So, you'll have to exercise a bit of care in how/where you initialize
things.  But, it does work. :)

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to