[ 
http://issues.apache.org/jira/browse/TAPESTRY-1200?page=comments#action_12459717
 ] 
            
Samppa Saarela commented on TAPESTRY-1200:
------------------------------------------

It does the trick. Thanks!

> Block as Shell's delegate
> -------------------------
>
>                 Key: TAPESTRY-1200
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1200
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.0, 4.1, 4.0.1, 4.0.2, 4.1.1
>            Reporter: Samppa Saarela
>            Priority: Minor
>
> Custom headers of Shell would be quite intuitive to be able to define 
> directly in templates, by using Block component:
> <html jwcid="@Shell" delegate="ognl: components.head">
> <head jwcid="[EMAIL PROTECTED]">
> <!-- custom headers that can e.g. use assets for extra scripts --> 
> </head>
> <body>
> ...
> </body>
> </html>
> This kind of usage can be enabled with a slight modification to Shell: 
> IRender delegate = getDelegate();
> if (delegate != null) {
>     if (delegate instanceof Block) {
>         Block block = (Block) delegate;
>         IComponent previousInserter = block.getInserter();
>         block.setInserter(this);
>         block.renderBody(writer, cycle);
>         // reset the inserter as it was before we changed it
>         block.setInserter(previousInserter);
>     } else {
>         delegate.render(writer, cycle);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to