You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Steve Eynon (Created) (JIRA)" <ji...@apache.org> on 2011/10/19 19:37:10 UTC

[jira] [Created] (TAP5-1707) The RenderNotification Mixin should documented with an example

The RenderNotification Mixin should documented with an example
--------------------------------------------------------------

                 Key: TAP5-1707
                 URL: https://issues.apache.org/jira/browse/TAP5-1707
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.3
            Reporter: Steve Eynon
            Priority: Trivial


The RenderNotification Mixin seems to be an idiomatic way to generate render phase 'like' events during an Ajax rendering. But alas the concept is a tricky one with a couple of gotchas and could really do with a worked example (in the JavaDocs) to fully explain its usage.

The email thread is :

http://tapestry.1045711.n5.nabble.com/T5-2-Looking-For-A-RenderNotification-Mixin-Example-td4917771.html

I've picked out some relevant bits...

I would like some pre and post render events to be fired on a component after it's handled an Ajax event and returned a Zone which it contains.

<div t:type="Zone" id="zone">
       <div t:type="Any" t:mixins="RenderNotification">
               <!-- zone content ->
       </div>
</div>

When the Any component renders as a whole, it receives the render phase methods which are picked up the Mixin. The Mixin then fires its own component events with the same name, which  bubble up the component hierarchy.

But the beforeRender and afterRender triggered by this mixins are not render events, so they should be handled by onBeforeRender[FromComponentId] and onAfterRender[FromComponentId] methods or @OnEvent(value = "afterRender", component = "id"). In both cases, the component id is optional.

Nice one - I may have overlooked the onBeginRender() vs beginRender().


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1707) The RenderNotification Mixin should documented with an example

Posted by "Steve Eynon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131776#comment-13131776 ] 

Steve Eynon commented on TAP5-1707:
-----------------------------------

[from the email thread]

After trying out a few examples I find the following does exactly the same job but is much clearer to anyone reading the code: 

<div t:type="Zone" id="zone"> 
    <t:trigger event="beginRender" /> 

    <!-- zone content -> 

    <t:trigger event="afterRender" /> 
</div> 

It also has the added benifit of not rendering a surplus div tag in the HTML. 
                
> The RenderNotification Mixin should documented with an example
> --------------------------------------------------------------
>
>                 Key: TAP5-1707
>                 URL: https://issues.apache.org/jira/browse/TAP5-1707
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Steve Eynon
>            Priority: Trivial
>              Labels: documentation
>
> The RenderNotification Mixin seems to be an idiomatic way to generate render phase 'like' events during an Ajax rendering. But alas the concept is a tricky one with a couple of gotchas and could really do with a worked example (in the JavaDocs) to fully explain its usage.
> The email thread is :
> http://tapestry.1045711.n5.nabble.com/T5-2-Looking-For-A-RenderNotification-Mixin-Example-td4917771.html
> I've picked out some relevant bits...
> I would like some pre and post render events to be fired on a component after it's handled an Ajax event and returned a Zone which it contains.
> <div t:type="Zone" id="zone">
>        <div t:type="Any" t:mixins="RenderNotification">
>                <!-- zone content ->
>        </div>
> </div>
> When the Any component renders as a whole, it receives the render phase methods which are picked up the Mixin. The Mixin then fires its own component events with the same name, which  bubble up the component hierarchy.
> But the beforeRender and afterRender triggered by this mixins are not render events, so they should be handled by onBeforeRender[FromComponentId] and onAfterRender[FromComponentId] methods or @OnEvent(value = "afterRender", component = "id"). In both cases, the component id is optional.
> Nice one - I may have overlooked the onBeginRender() vs beginRender().

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1707) The RenderNotification Mixin should documented with an example

Posted by "Steve Eynon (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131776#comment-13131776 ] 

Steve Eynon commented on TAP5-1707:
-----------------------------------

[from the email thread]

After trying out a few examples I find the following does exactly the same job but is much clearer to anyone reading the code: 

<div t:type="Zone" id="zone"> 
    <t:trigger event="beginRender" /> 

    <!-- zone content -> 

    <t:trigger event="afterRender" /> 
</div> 

It also has the added benifit of not rendering a surplus div tag in the HTML. 
                
> The RenderNotification Mixin should documented with an example
> --------------------------------------------------------------
>
>                 Key: TAP5-1707
>                 URL: https://issues.apache.org/jira/browse/TAP5-1707
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Steve Eynon
>            Priority: Trivial
>              Labels: documentation
>
> The RenderNotification Mixin seems to be an idiomatic way to generate render phase 'like' events during an Ajax rendering. But alas the concept is a tricky one with a couple of gotchas and could really do with a worked example (in the JavaDocs) to fully explain its usage.
> The email thread is :
> http://tapestry.1045711.n5.nabble.com/T5-2-Looking-For-A-RenderNotification-Mixin-Example-td4917771.html
> I've picked out some relevant bits...
> I would like some pre and post render events to be fired on a component after it's handled an Ajax event and returned a Zone which it contains.
> <div t:type="Zone" id="zone">
>        <div t:type="Any" t:mixins="RenderNotification">
>                <!-- zone content ->
>        </div>
> </div>
> When the Any component renders as a whole, it receives the render phase methods which are picked up the Mixin. The Mixin then fires its own component events with the same name, which  bubble up the component hierarchy.
> But the beforeRender and afterRender triggered by this mixins are not render events, so they should be handled by onBeforeRender[FromComponentId] and onAfterRender[FromComponentId] methods or @OnEvent(value = "afterRender", component = "id"). In both cases, the component id is optional.
> Nice one - I may have overlooked the onBeginRender() vs beginRender().

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira