onActivate() (i.e., the "activate" event) is not part of rendering, it comes very early in the request handling process.
I think you want to do something more like beginRender() or even setupRender(). On 9/30/07, Chris Lewis <[EMAIL PROTECTED]> wrote: > > FYI I just upgraded to 5.0.6-SNAPSHOT with the same results. > > Howard Lewis Ship wrote: > > Could we see your Start page? > > > > > > On 9/28/07, Chris Lewis <[EMAIL PROTECTED]> wrote: > > > >> I'm creating something like DocumentScriptBuilder for inserting > >> stylesheets, much like DocumentScriptBuilderImpl does for javascripts. > I > >> have this method in my app module, inspired by the method in > >> TapestryModule: > >> > >> public void > >> contributePageRenderInitializer(OrderedConfiguration<PageRenderCommand> > >> configuration) { > >> > >> configuration.add("DocumentStyleBuilder", new > PageRenderCommand() > >> { > >> > >> public void cleanup(Environment environment) { > >> DocumentStyleBuilder builder = > >> environment.pop(DocumentStyleBuilder.class); > >> Document doc = environment.peek(Document.class); > >> builder.updateDocument(doc); > >> } > >> > >> public void setup(Environment environment) { > >> environment.push(DocumentStyleBuilder.class, new > >> DocumentStyleBuilderImpl()); > >> } > >> > >> }, "before:PageRenderSupport"); > >> } > >> > >> When I try to inject this via @Environmental, a RuntimeException is > >> thrown with this message: > >> "No object of type xxx.services.DocumentStyleBuilder is available from > >> the Environment. Available types are ." > >> > >> With logging I've verified that this is thrown _before_ my contribution > >> is called, suggesting that the page using the @Environmental (my Start > >> page) is initialized before my contribution is called. I tried using > >> "before:PageRenderSupport" as a constraint to no avail. How can I get > my > >> object into the environment, since mimicking what's in TapestryModule > >> doesn't seem to work? > >> > >> thanks! > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind