Author: buildbot
Date: Mon Feb 26 00:23:00 2018
New Revision: 1025972
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 Feb 26
00:23:00 2018
@@ -32,7 +32,6 @@
<script src='/resources/highlighter/scripts/shCore.js'
type='text/javascript'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
<script src='/resources/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='/resources/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -77,7 +76,7 @@
</div>
<div id="content">
- <div id="ConfluenceContent"><p><strong>Component
events</strong> are Tapestry's way of conveying a user's interactions with the
web page, such as clicking links and submitting forms, to designated methods in
your page and component classes. When a component event is triggered, Tapestry
calls the event handler method you've provided, if any, in the containing
component's class.</p><div class="aui-label" style="float:right" title="Related
Articles">
+ <div id="ConfluenceContent"><p><strong>Component
events</strong> are Tapestry's way of conveying a user's interactions with the
web page, such as clicking links and submitting forms, to designated methods in
your page and component classes. When a component event is triggered, Tapestry
calls the event handler method you've provided, if any, in the containing
component's class.</p><div class="aui-label" style="float:right; max-width:
30%; margin: 1em" title="Related Articles">
@@ -218,9 +217,12 @@ void editDocument(int docId)
dao.executeQuery();
}
</pre>
-</div></div><p>Your event handler method may even declare that it "throws
Exception" if that is more convenient.</p><h1
id="ComponentEvents-InterceptingEventExceptions">Intercepting Event
Exceptions</h1><p>When an event handler method throws an exception (checked or
runtime), Tapestry gives the component and its containing page a chance to
handle the exception, before continuing on to report the exception.</p><div
class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
-<p> <strong>JumpStart Demo:</strong><br clear="none">
- <a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/handlingabadcontext/1"
rel="nofollow">Handling A Bad Context</a></p></div>Tapestry triggers a new
event, of type "exception", passing the thrown exception as the context. In
fact, the exception is wrapped inside a <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/runtime/ComponentEventException.html">ComponentEventException</a>,
from which you may extract the event type and context.<p>Thus:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p>Your event handler method may even declare that it "throws
Exception" if that is more convenient.</p><h1
id="ComponentEvents-InterceptingEventExceptions">Intercepting Event
Exceptions</h1><p>When an event handler method throws an exception (checked or
runtime), Tapestry gives the component and its containing page a chance to
handle the exception, before continuing on to report the exception.</p><div
style="float: right; max-width: 30%; margin: 1em"><div class="panel"
style="border-color: #eee;border-width: 1px;"><div class="panelHeader"
style="border-bottom-width: 1px;border-bottom-color: #eee;background-color:
#eee;"><b>JumpStart Demo</b></div><div class="panelContent">
+<p><a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/handlingabadcontext/1"
rel="nofollow">Handling A Bad Context</a></p>
+</div></div></div>
+
+
+<p> </p><p>Tapestry triggers a new event, of type "exception", passing
the thrown exception as the context. In fact, the exception is wrapped inside a
<a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/runtime/ComponentEventException.html">ComponentEventException</a>,
from which you may extract the event type and context.</p><p>Thus:</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;"> Object onException(Throwable cause)
{
message = cause.getMessage();
@@ -228,9 +230,12 @@ void editDocument(int docId)
return this;
}
</pre>
-</div></div><p>The return value of the exception event handler
<em>replaces</em> the return value of original event handler method. For the
typical case (an exception thrown by an "activate" or "action" event), this
will be a <a href="page-navigation.html">navigational response</a> such as a
page instance or page name.</p><p>This can be handy for handling cases where
the data in the URL is incorrectly formatted.</p><p>In the above example, the
navigational response is the page itself.</p><p>If there is no exception event
handler, or the exception event handler returns null (or is void), then the
exception will be passed to the <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html">RequestExceptionHandler</a>
service, which (in the default configuration) will render the exception
page.</p><h1 id="ComponentEvents-TriggeringEvents">Triggering
Events</h1><p></p><div class="navmenu" style="float:right; backg
round:#eee; margin:3px; padding:0 1em">
-<p> <strong>JumpStart Demo:</strong><br clear="none">
- <a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/together/ajaxcomponentscrud/persons"
rel="nofollow">AJAX Components CRUD</a></p></div>If you want your own
component to trigger events, just call the <code>triggerEvent</code> method of
<a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentResources.html">ComponentResources</a>
from within your component class.<p>For example, the following triggers an
"updateAll" event. A containing component can then respond to it, if desired,
with an "onUpdateAll()" method in its own component class.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>Your component class
(partial)</b></div><div class="codeContent panelContent pdl">
+</div></div><p>The return value of the exception event handler
<em>replaces</em> the return value of original event handler method. For the
typical case (an exception thrown by an "activate" or "action" event), this
will be a <a href="page-navigation.html">navigational response</a> such as a
page instance or page name.</p><p>This can be handy for handling cases where
the data in the URL is incorrectly formatted.</p><p>In the above example, the
navigational response is the page itself.</p><p>If there is no exception event
handler, or the exception event handler returns null (or is void), then the
exception will be passed to the <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestExceptionHandler.html">RequestExceptionHandler</a>
service, which (in the default configuration) will render the exception
page.</p><h1 id="ComponentEvents-TriggeringEvents">Triggering Events</h1><div
style="max-width: 30%; float: right; margin: 1em
"><div class="panel" style="border-color: #eee;border-width: 1px;"><div
class="panelHeader" style="border-bottom-width: 1px;border-bottom-color:
#eee;background-color: #eee;"><b>JumpStart Demo</b></div><div
class="panelContent">
+<p><a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/together/ajaxcomponentscrud/persons"
rel="nofollow">AJAX Components CRUD</a></p>
+</div></div></div>
+
+
+<p> </p><p>If you want your own component to trigger events, just call
the <code>triggerEvent</code> method of <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentResources.html">ComponentResources</a>
from within your component class.</p><p>For example, the following triggers an
"updateAll" event. A containing component can then respond to it, if desired,
with an "onUpdateAll()" method in its own component class.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>Your component class
(partial)</b></div><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">@Inject
ComponentResources componentResources;
 ...
@@ -240,7 +245,7 @@ private void timeToUpdate() {
...
}
} </pre>
-</div></div><p>The third parameter to triggerEvent is a
ComponentEventCallback, which you'll only need to implement if you want to get
the return value of the handler method. The return value of <span
class="il">triggerEvent</span>() says if the <span class="il">event</span> was
handled or not.</p><p> </p></div>
+</div></div><p>The third parameter to triggerEvent is a
ComponentEventCallback, which you'll only need to implement if you want to get
the return value of the handler method. The return value of <span
class="il">triggerEvent</span>() says if the <span class="il">event</span> was
handled or not.</p><p></p></div>
</div>
<div class="clearer"></div>