Repository: tapestry-5 Updated Branches: refs/heads/master 10f1f8d0f -> e3c2d044f
TAP5-1707 javadoc improvements for RenderNotification mixin Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e3c2d044 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e3c2d044 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e3c2d044 Branch: refs/heads/master Commit: e3c2d044f70739c13fd744cf5c67d8c2aa8d91d8 Parents: 10f1f8d Author: Bob Harner <[email protected]> Authored: Sun Feb 28 21:57:27 2016 -0500 Committer: Bob Harner <[email protected]> Committed: Sun Feb 28 22:04:35 2016 -0500 ---------------------------------------------------------------------- .../corelib/mixins/RenderNotification.java | 43 +++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e3c2d044/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/RenderNotification.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/RenderNotification.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/RenderNotification.java index 8e6e69f..734291f 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/RenderNotification.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/RenderNotification.java @@ -24,12 +24,43 @@ import org.apache.tapestry5.annotations.MixinAfter; import org.apache.tapestry5.ioc.annotations.Inject; /** - * This mixin triggers event notifcations to identify when it enters - * the {@link BeginRender} and {@link AfterRender} render phases. - * The {@link MarkupWriter} is passed as the event context. The most common use of this - * is to handle the "afterRender" event to generate client-side JavaScript for content - * just rendered via a {@link Block} (this is a common Ajax use case related to partial - * page rendering). + * This mixin triggers <em>component event</em> notifications when the + * attached component enters its {@link BeginRender} and {@link AfterRender} + * render phases. A common use of this is to handle the "afterRender" + * event to generate client-side JavaScript for content just rendered via a + * {@link Block} (this is a common Ajax use case related to partial page + * rendering). Since AJAX requests don't trigger afterRender or beforeRender + * render phase events in the containing component or page, this mixin provides + * a way of accessing those events as component events. + * <p> + * An example using the {@link org.apache.tapestry5.corelib.components.Any Any} + * component within a zone: + * <pre> + * <div t:type="Zone" id="myZone"> + * <t:any t:mixins="RenderNotification"> + * <!-- zone content -> + * </div> + * </div> + * </pre> + * The {@link MarkupWriter} is passed as the event context to your event handler + * method(s), so your corresponding component or page class might look like: + * <pre> + * void onBeginRenderFromMyZone(MarkupWriter writer) + * { + * writer.element("p"); + * writer.write("before item render"); + * writer.end(); + * } + + * void onAfterRenderFromMyZone(MarkupWriter writer) + * { + * writer.element("p"); + * writer.write("after item render"); + * writer.end(); + * } + * </pre> + * As an alternative, see the {@link org.apache.tapestry5.corelib.components.Trigger Trigger} + * component, which does something similar but as a component rather than a mixin. * * @since 5.2.0 * @tapestrydoc
