Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Copyright 2004, 2005 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
 //     http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.apache.tapestry.components;
Renders the text and components wrapped by a Blockcomponent. [ Component Reference ]

It is possible for an RenderBlock to obtain a Block from a page other than the render page. This works, even when the Block contains links, forms and form components. The action and direct services will create URLs that properly address this situation.

However, because the rendering page can't know ahead of time about these foreign Blocks, org.apache.tapestry.event.PageBeginRenderListener and org.apache.tapestry.event.PageEndRenderListener methods (for components and objects of the foreign page) via RenderBlock will not be executed. This specifically affects the methods of the org.apache.tapestry.event.PageBeginRenderListener and org.apache.tapestry.event.PageEndRenderListener interfaces.

Before rendering its Block, RenderBlock will set itself as the Block's inserter, and will reset the inserter after the Blockis rendered. This gives the components contained in the Blockaccess to its inserted environment via the RenderBlock. In particular this allows the contained components to access the informal parameters of the RenderBlock which effectively allows parameters to be passed to the components contained in a Block.

Author(s):
Howard Lewis Ship
public abstract class RenderBlock extends AbstractComponent
{

    
If block is not null, then Block#renderForComponent(IMarkupWriter , IRequestCycle , IComponent ) is invoked.
    protected void renderComponent(IMarkupWriter writerIRequestCycle cycle)
    {
        Block block = getBlock();
        if (block == nullreturn;
        block.renderForComponent(writercyclethis);
    }
    public abstract Block getBlock();
New to GrepCode? Check out our FAQ X