You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bu...@apache.org on 2016/05/09 11:19:53 UTC

svn commit: r987791 - in /websites/production/tapestry/content: cache/main.pageCache component-events.html

Author: buildbot
Date: Mon May  9 11:19:53 2016
New Revision: 987791

Log:
Production update by buildbot for tapestry

Modified:
    websites/production/tapestry/content/cache/main.pageCache
    websites/production/tapestry/content/component-events.html

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/tapestry/content/component-events.html
==============================================================================
--- websites/production/tapestry/content/component-events.html (original)
+++ websites/production/tapestry/content/component-events.html Mon May  9 11:19:53 2016
@@ -143,7 +143,7 @@
     </div>
 </t:loop>
 </pre>
-</div></div><p>Notice that Review.tml contains an ActionLink component in a loop. When rendered on the page, the ActionLink component creates a component event request URL, with the event type set to "action". In this case the URL might look like:</p><p><code><span class="external-link">&#160;&#160;&#160; http://localhost:8080/review.edit/3</span></code></p><p>This URL identifies the <strong>page</strong> that contains the component ("review"), the&#160;<strong>Component id</strong> of the component within the page ("edit"), and the <strong>context</strong> value ("3", the "id" property of the document). <em>Additional context values, if any, are appended to the path.</em> (The URL may also contain the <strong>event name</strong>, unless, as here, it is "action".)</p><p>There's no direct mapping from URL to a piece of code. Instead, when the user clicks on the link, the ActionLink component triggers events. And then Tapestry ensures that the correct bits of code (your event handler 
 method, see below) get invoked for those events.</p><p>This demonstrates a critical difference between Tapestry and a more traditional, action oriented framework. The URL doesn't say what happens when the link is clicked, it identifies <em>which component is responsible</em> when the link is clicked.</p><p>Often, a navigation request (originating with the user) will spawn a number of flow-of-control requests. For example, a form component may trigger an action event, which will then trigger notification events to announce when the form submission is about to be processed, and whether it was successful or not, and those event could be further handled by the page component.</p><h1 id="ComponentEvents-EventHandlerMethods">Event Handler Methods</h1><p>When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via the @<a  cl
 ass="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/OnEvent.html">OnEvent</a> annotation.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Notice that Review.tml contains an ActionLink component in a loop. For each rendering within the loop, the ActionLink component creates a component event request URL, with the event type set to "action". In this case, each URL might look like:</p><p><code><span class="external-link">&#160;&#160;&#160; http://localhost:8080/review.edit/3</span></code></p><p>This URL identifies the <strong>page</strong> that contains the component ("review"), the&#160;<strong>Component id</strong> of the component within the page ("edit"), and the <strong>context</strong> value ("3", the "id" property of the document). <em>Additional context values, if any, are appended to the path.</em> (The URL may also contain the <strong>event name</strong>, unless, as here, it is "action".)</p><p>There's no direct mapping from URL to a piece of code. Instead, when the user clicks on the link, the ActionLink component triggers events. And then Tapestry ensures that the correct bits of code (your eve
 nt handler method, see below) get invoked for those events.</p><p>This demonstrates a critical difference between Tapestry and a more traditional, action oriented framework. The URL doesn't say what happens when the link is clicked, it identifies <em>which component is responsible</em> when the link is clicked.</p><p>Often, a navigation request (originating with the user) will spawn a number of flow-of-control requests. For example, a form component may trigger an action event, which will then trigger notification events to announce when the form submission is about to be processed, and whether it was successful or not, and those event could be further handled by the page component.</p><h1 id="ComponentEvents-EventHandlerMethods">Event Handler Methods</h1><p>When a component event occurs, Tapestry invokes any event handler methods that you have identified for that event. You can identify your event handler methods via a naming convention (see Method Naming Convention below), or via 
 the @<a  class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/OnEvent.html">OnEvent</a> annotation.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@OnEvent(component="edit")
 void editDocument(int docId)
 {
@@ -151,7 +151,7 @@ void editDocument(int docId)
     // do something with the document here
 }
 </pre>
-</div></div><p>Tapestry does two things here:</p><ul><li>Because of the annotation, it identifies method editDocument() as the method to invoke whenever the component whose ID is "edit" ActionLink component triggers an event.</li><li>Because there is a method parameter, when the link is clicked the context value of the request is converted from a string to an integer and passed in as the method's value parameter.<br clear="none"><br clear="none"></li></ul>
+</div></div><p>Tapestry does two things here:</p><ul><li>Because of the annotation, it identifies method editDocument() as the method to invoke whenever the component whose ID is "edit" triggers an event.</li><li>Because there is a method parameter, when the link is clicked the context value of the request is converted from a string to an integer and passed in as the method's value parameter.<br clear="none"><br clear="none"></li></ul>
 
 <div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
 </div></div>