DynamicBlock Version 2 Example

DynamicBlock determines the component to be rendered at run-time via the componentName parameter.

This is version 2 of DynamicBlock and the example application. The DynamicBlock may now be wrapped around a body. If this is the case then any component resolved by the componentName parameter must allow a body and should include a RenderBody component to display the body of the DynamicBlock. If this is not the case DynamicBlock will throw an exception (as does the NoBodyAllowed component in the section below).

DynamicBlock is similar to Block/RenderBlock without the need to define a Block. This allows your logic to determine which component to use without having to reference the component in a template.

Choose a component to display in the DynamicBlock:

The page includes the groovestry:InspectorButton component which will display the Inspector Page. This page is a Groovy scripted page so you can see all of the application and component code via the inspector.

1

This is the body, wrapped by the switched component. I'm not sure if this should really work and what effect, if any it has on page listeners, or component paths, but it does render!

And to prove that components can be wrapped as well, todays date is: Mon Dec 01 19:23:58 EST 2008.