I have to select which block to render depending upon database
configuration. To keep clean HTML mock-ups, I have moved the blocks into
a separate page. The blocks are specified as separate components,
subclassing Block.

My problem is that they don't get rendered at all and I'm not sure why.

Home.html:
...
<span jwcid="forEachModule">
        <div style="border: 1px" jwcid="blockDiv">
                <span jwcid="renderBlock"/>
        </div>
</span>
...

Home.page:
...
<component id="renderBlock" type="RenderBlock">
        <binding name="block" value="ognl: currentBlock"/>
        <binding name="featureModule" value="ognl: currentModule"/>
</component>
...

Using featureModule as an informal parameter to pass to the rendering
block, retrieved through getParameter("featureModule") in block class.

HomePage.java:
...
public Block getCurrentBlock() {
        IPage blocksPage = getCycle().getPage("Blocks");
        Block block = (Block) blocksPage.getComponent("fullWidthBlock");
        return block;
}
...

Blocks.page:
...
<component id="fullWidthBlock" type="FullWidthBlock"/>
...

FullWidthBlock never gets rendered. If fullWidthBlock is just static
HTML contained in Blocks.html rather than FullWidthBlock.html, it gets
rendered fine, but I would rather not have to have all HTML for each
block I have to render in Blocks.html.  In fact that wouldn't be
possible as I have to pass a parameter to the Block to render
(featureModule informal parameter above).

Have I missed something or is this just not possible at the moment?

Thanks for your help,
Jim Dyson



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

Reply via email to