> 
> 
>> BTW,  I'm mucking around with my first component and during @SetupRender 
>> phase I have no data and return false to jump directly to @CleanupRender - 
>> which outputs my div saying "There is no data".
>> 
>> I know this (@CleanupRender) will output all the time when I have elements 
>> to write out in @BeginRender phases, but I'm just slowly stepping through it 
>> all so I understand the render phases a bit better.
> 
> See http://tapestry.apache.org/component-rendering.html and 
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen.


Just an FYI,
Inspecting jumpstart, and the component rendering page, I couldn't get 
@BeforeRenderBody to fire.

        @BeforeRenderTemplate
        boolean beforeRenderTemplate(MarkupWriter writer){
                Element cur = writer.element("div",
                                
"class","userbackground").addClassName("adifferentbackground");
                cur.text("CHRIS! This is your amazing test div - 
beforeRenderTemplate");
                writer.end();
                
                return true ;
        }
        
        @BeforeRenderBody
        void beforeRenderBody(MarkupWriter writer){
                
                Element cur = writer.element("div",
                                
"class","userbackground").addClassName("adifferentbackground");
                cur.text("CHRIS! This is your amazing test div - 
beforeRenderBody");
                writer.end();

        }

The component rendering page says "...Generally, your code will use the 
SetupRender, BeginRender, AfterRender and CleanupRender phases ... often just 
one or two of those..."  which I'm happy with.

Is the diagram accurate as to this @BeforeRenderBody annotation?  For my case,  
I'm happy to use beginRender - I just can't seem to follow the flow to get 
@BeforeRenderBody to do what is suggested on 
https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents for the 
tree example.


Cheers
Chris

Reply via email to