Posted the earlier question before reading your post.  Here is the code in my
AppModule:

   public void
contributeMarkupRenderer(OrderedConfiguration<MarkupRendererFilter>
configuration,

            @Symbol(SymbolConstants.PRODUCTION_MODE)
            final boolean productionMode,

            @Symbol(SymbolConstants.SCRIPTS_AT_TOP)
            final boolean scriptsAtTop,
            
            @Inject final Environment environment)
    {
                    
        MarkupRendererFilter myDocumentLinker = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer
renderer)
            {
                MyDocumentLinkerImpl linker = new
MyDocumentLinkerImpl(productionMode, scriptsAtTop);

                environment.push(DocumentLinker.class, linker);

                renderer.renderMarkup(writer);

                environment.pop(DocumentLinker.class);

                linker.updateDocument(writer.getDocument());
            }
        };
        configuration.add("MyCustomDocumentLinker", myDocumentLinker,
"before:DocumentLinker");
       }

The above code does not seem to be working. I still get the "The root
element of the rendered document was <div>, not <html>. A root element of
<html> is needed when linking JavaScript and stylesheet resources." errors.

And MyDocumentLinkerImpl class implements the DocumentLinker interface and
has the code to not to validate for <html> as root node.

Am I missing something?


Thiago H. de Paula Figueiredo wrote:
> 
> Em Thu, 29 Jan 2009 14:42:47 -0300, Dude.Checkitout  
> <dude.checkit...@gmail.com> escreveu:
> 
>> I created my own CustomDocumentLinker extending from the tapestry
>> DocumentLinker and modified the code to fit our needs. But I have no idea
>> how to make Tapestry to use CustomerDocumentLinker instead of its own
>> DocumentLinker.
> 
> Contribute you own DocumentLinker to the MarkupRenderer service. Something  
> like this in your AppModule class or any other Tapestry-IoC module class:
> 
> public void  
> contributePartialMarkupRenderer(OrderedConfiguration<PartialMarkupRendererFilter>
>   
> configuration) {
> 
>       configuration.add("CustomDocumentLinker", new CustomDocumentLinke(),  
> "before:DocumentLinker");
> 
> }
> 
> I haven't tested it, but that's what I would try. :)
> By the way, a good knowledge of Tapestry-IoC is not required to use  
> Tapestry, but it helps a lot. ;)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/How-to-override-Tapestry%27s-DocumentLinker---tp2239793p2240470.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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

Reply via email to