Re: How to render a block parameter in component

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GZOY=3z6=1v69MBYhz7jfkpAattyr5biERDj64wbQYoFA@mail.gmail.com>
Great example, but some spellchecking needed, hehehe. <t:delegate
to="headerContent"/>

On Thu, Aug 31, 2017 at 3:54 AM, Carlos Montero Canabal <
[email protected]> wrote:

> Hi!
>
> To render a block you have to write
>
> <t:deletage to=“headerContent”/>
>
> So, in your layout.ml file:
>
> <body>
>         <t:deletage to=“headerContent”/>
> </body>
>
> > El 31/8/2017, a las 8:46, Joshua Richardson <[email protected]>
> escribió:
> >
> > I want to pass a block of rendered html as a component parameter.  After
> 2hrs searching I have been unable to find the right doc or example.  I have
> a suspicion that it may involve creating a render() handler, but I'm hoping
> there's a simpler way.
> >
> >
> > public class Layout {
> >
> >  @Property
> >
> >  @Parameter(required = false)
> >
> >  private Block headerContent;
> >
> > }
> >
> >
> > layout.tml >> EOF
> >
> > <!DOCTYPE html>
> >
> > <html lang="en" xmlns="http://www.w3.org/1999/xhtml"
> >
> >      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
> >
> >>
> >
> >  <body>${prop:headerContent}</body>
> >
> > </html>
> >
> > EOF
> >
> >
> > page.tml >> EOF2
> >
> > <html t:type="layout" title="site Index"
> >
> >      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd"
> >
> >      xmlns:p="tapestry:parameter"
> >
> >>
> >
> >
> >
> >    <p:headerContent>
> >
> >    content rendered at page level
> >
> >    </p:headerContent>
> >
> > </html>
> >
> > EOF2
> >
> >
> > expected output >> EOF3
> >
> > <html>
> >
> >   <body>content rendered at page level</body>
> >
> > </html>
> >
> > EOF3
> >
> >
> > actual output >> EOF4
> >
> > <html>
> >
> >   <body>Block[Parameter headerContent of Index:layout, at
> classpath:com/example/pages/Index.tml, line 6]</body>
> >
> > </html>
> >
> > EOF4
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Thiago
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.