You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2013/11/11 23:13:16 UTC

svn commit: r1540864 [4/38] - in /wicket/common/site/trunk/_site/guide: ./ gapi/ gapi/DefaultPackage/ gapi/spring/ guide/ guide/pages/ guide/src/docs/guide/ guide/src/docs/img/ guide/src/docs/imgOrigin/ img/

Modified: wicket/common/site/trunk/_site/guide/guide/chapter16.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter16.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter16.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter16.html Mon Nov 11 22:13:12 2013
@@ -2,7 +2,7 @@
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <title>16 Wicket advanced topics 6.x</title>
+    <title>17 Wicket advanced topics 6.x</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
     <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
@@ -27,79 +27,82 @@ function addJsClass() {
                     <div class="toc-item" style="margin-left:0"><a href="../guide/chapter1.html"><strong>1</strong><span>Introduction</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>2</strong><span>Why should I learn Wicket?</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/howToSource.html"><strong>2</strong><span>How to use the example code</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>3</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>3</strong><span>Why should I learn Wicket?</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>4</strong><span>Wicket as page layout manager</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>4</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>5</strong><span>Keeping control over HTML</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>5</strong><span>Wicket as page layout manager</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>6</strong><span>Components lifecycle</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>6</strong><span>Keeping control over HTML</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>7</strong><span>Page versioning and caching</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>7</strong><span>Components lifecycle</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>8</strong><span>Under the hood of the request processing</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>8</strong><span>Page versioning and caching</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>9</strong><span>Wicket Links and URL generation</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>9</strong><span>Under the hood of the request processing</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>10</strong><span>Wicket models and forms</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>10</strong><span>Wicket Links and URL generation</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>11</strong><span>Wicket forms in detail</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>11</strong><span>Wicket models and forms</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>12</strong><span>Displaying multiple items with repeaters</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>12</strong><span>Wicket forms in detail</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>13</strong><span>Internationalization with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>13</strong><span>Displaying multiple items with repeaters</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>14</strong><span>Resource management with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>14</strong><span>Internationalization with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>15</strong><span>An example of integration with JavaScript</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>15</strong><span>Resource management with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>16</strong><span>Wicket advanced topics</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>16</strong><span>An example of integration with JavaScript</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>17</strong><span>Working with AJAX</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>17</strong><span>Wicket advanced topics</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>18</strong><span>Integration with enterprise containers</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>18</strong><span>Working with AJAX</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>19</strong><span>Security with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>19</strong><span>Integration with enterprise containers</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>20</strong><span>Test Driven Development with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>20</strong><span>Security with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>21</strong><span>Test Driven Development with Wicket and Spring</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>21</strong><span>Test Driven Development with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>22</strong><span>Wicket Best Practices</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>22</strong><span>Test Driven Development with Wicket and Spring</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>23</strong><span>Working with Maven (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>23</strong><span>Wicket Best Practices</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>24</strong><span>Project WicketStuff (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>24</strong><span>Working with Maven (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>25</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>25</strong><span>Project WicketStuff (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>26</strong><span>Contributing to this guide (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>26</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>27</strong><span>Contributing to this guide (Appendix)</span></a>
                     </div>
                     
                 </div>
@@ -129,18 +132,18 @@ function addJsClass() {
             <div id="main" class="corner-all">
 
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter15.html">&lt;&lt; <strong>15</strong><span>An example of integration with JavaScript</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter15.html">&lt;&lt; <strong>16</strong><span>An example of integration with JavaScript</span></a></div>
                 
 
                 <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
 
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter17.html"><strong>17</strong><span>Working with AJAX</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter17.html"><strong>18</strong><span>Working with AJAX</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>16 Wicket advanced topics - Reference Documentation</h1>
+                    <h1>17 Wicket advanced topics - Reference Documentation</h1>
 
                     <p><strong>Authors:</strong> Andrea Del Bene, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul Borș</p>
 
@@ -153,22 +156,22 @@ function addJsClass() {
                 <div id="table-of-content">
                     <h2>Table of Contents</h2>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_1"><strong>16.1</strong><span>Enriching components with behaviors</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_1"><strong>17.1</strong><span>Enriching components with behaviors</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_2"><strong>16.2</strong><span>Generating callback URLs with IRequestListener</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_2"><strong>17.2</strong><span>Generating callback URLs with IRequestListener</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_3"><strong>16.3</strong><span>Initializers</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_3"><strong>17.3</strong><span>Initializers</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_4"><strong>16.4</strong><span>Using JMX with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_4"><strong>17.4</strong><span>Using JMX with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_5"><strong>16.5</strong><span>Generating HTML markup from code</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_5"><strong>17.5</strong><span>Generating HTML markup from code</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_6"><strong>16.6</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter16_6"><strong>17.6</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -176,11 +179,11 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter16">16 Wicket advanced topics</h1>
+<h1 id="chapter16">17 Wicket advanced topics</h1>
 In this chapter we will learn some advanced topics which have not been covered yet in the previous chapters but which are nonetheless essential to make the most of Wicket and to build sophisticated web applications.
 
 
-<h2 id="chapter16_1">16.1 Enriching components with behaviors</h2>
+<h2 id="chapter16_1">17.1 Enriching components with behaviors</h2>
 <p class="paragraph"/>With class org.apache.wicket.behavior.Behavior Wicket provides a very flexible mechanism to share common features across different components and to enrich existing components with further functionalities. As the class name suggests, Behavior adds a generic behavior to a component modifying its markup and/or contributing to the header section of the page (Behavior implements the interface IHeaderContributor).<p class="paragraph"/>One or more behaviors can be added to a component with Component's method add(Behavior...), while to remove a behavior we must use method remove(Behavior).<p class="paragraph"/>Here is a partial list of methods defined inside class Behavior along with a brief description of what they do:
 <ul class="star">
 <li><strong class="bold">beforeRender(Component component)</strong>: called when a component is about to be rendered.</li>
@@ -208,7 +211,7 @@ In this chapter we will learn some advan
 
 
 
-<h2 id="chapter16_2">16.2 Generating callback URLs with IRequestListener</h2>
+<h2 id="chapter16_2">17.2 Generating callback URLs with IRequestListener</h2>
 <p class="paragraph"/>With Wicket it's quite easy to build a callback URL that executes a specific method on server side. This method must be defined in a functional interface (i.e. an an interface that defines just one method) that inherits from built-in org.apache.wicket.IRequestListener and it must be a void method with no parameters in input:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> <span class="java&#45;keyword">interface</span> IMyListener <span class="java&#45;keyword">extends</span> IRequestListener
 &#123;
 	/&#42;&#42;
@@ -270,7 +273,7 @@ IEventSource exposes a single method nam
 
 
 
-<h2 id="chapter16_3">16.3 Initializers</h2>
+<h2 id="chapter16_3">17.3 Initializers</h2>
 <p class="paragraph"/>Some components or resources may need to be configured before being used in our applications. While so far we used Application's init method to initialize these kinds of entities, Wicket offers a more flexible and modular way to configure our classes.<p class="paragraph"/>During application's bootstrap Wicket searches for any properties file named wicket.properties  placed in one of the classpath roots visible to the application. When one of these files is found, the initializer defined inside it will be executed. An initializer is an implementation of interface org.apache.wicket.IInitializer and is defined inside wicket.properties with a line like this:<p class="paragraph"/><div class="code"><pre>initializer=org.wicketTutorial.MyInitializer</pre></div><p class="paragraph"/>The fully qualified class name corresponds to the initializer that must be executed. Interface IInitializer defines method init(Application) which should contain our initialization code, and
  method destroy(Application) which is invoked when application is terminated:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class MyInitializer <span class="java&#45;keyword">implements</span> IInitializer&#123;<p class="paragraph"/>	<span class="java&#45;keyword">public</span> void init(Application application) &#123;
 		//initialization code 
 	&#125;<p class="paragraph"/>	<span class="java&#45;keyword">public</span> void destroy(Application application) &#123;
@@ -285,11 +288,11 @@ IEventSource exposes a single method nam
 &#125;</pre></div>
 
 
-<h2 id="chapter16_4">16.4 Using JMX with Wicket</h2>
+<h2 id="chapter16_4">17.4 Using JMX with Wicket</h2>
 <p class="paragraph"/>JMX (Java Management Extensions) is the standard technology adopted in Java for managing and monitoring running applications or Java Virtual Machines. Wicket offers support for JMX through module wicket-jmx. In this paragraph we will see how we can connect to a Wicket application using JMX. In our example we will use JConsole as JMX client. This program is bundled with Java SE since version 5 and we can run it typing jconsole in our OS shell.<p class="paragraph"/>Once JConsole has started it will ask us to establish a new connection to a Java process, choosing between a local process or a remote one. In the following picture we have selected the process corresponding to the local instance of Jetty server we used to run one of our example projects:<p class="paragraph"/><img border="0" class="center" src="../img/JMX-new-connection.png"></img><p class="paragraph"/>After we have established a JMX connection, JConsole will show us the following set of tabs:<p class=
 "paragraph"/><img border="0" class="center" src="../img/JMX-console.png"></img><p class="paragraph"/>JMX exposes application-specific informations using special objects called MBeans (Manageable Beans), hence if we want to control our application we must open the corresponding tab. The MBeans containing the application's informations is named org.apache.wicket.app.&#60;filter/servlet name&#62;.<p class="paragraph"/>In our example we have used wicket.test as filter name for our application:<p class="paragraph"/><img border="0" class="center" src="../img/JMX-console2.png"></img><p class="paragraph"/>As we can see in the picture above, every MBean exposes a node containing its attributes and another node showing the possible operations that can be performed on the object. In the case of a Wicket application the available operations are clearMarkupCache and clearLocalizerCache:<p class="paragraph"/><img border="0" class="center" src="../img/JMX-console3.png"></img><p class="paragraph"/>
 With these two operations we can force Wicket to clear the internal caches used to load components markup and resource bundles. This can be particularly useful if we have our application running in DEPLOYMENT mode and we want to publish minor fixes for markup or bundle files (like spelling or typo corrections) without restarting the entire application. Without cleaning these two caches Wicket would continue to use cached values ignoring any change made to markup or bundle files.<p class="paragraph"/>Some of the exposed properties are editable, hence we can tune their values while the application is running. For example if we look at the properties of ApplicationSettings we can set the maximum size allowed for an upload modifying the attribute DefaultMaximumUploadSize:<p class="paragraph"/><img border="0" class="center" src="../img/JMX-console4.png"></img>
 
 
-<h2 id="chapter16_5">16.5 Generating HTML markup from code</h2>
+<h2 id="chapter16_5">17.5 Generating HTML markup from code</h2>
 <p class="paragraph"/>So far, as markup source for our pages/panels we have used a static markup file, no matter if it was inherited or directly associated to the component. Now we want to investigate a more complex use case where we want to dynamical generate the markup directly inside component code.<p class="paragraph"/>To become a markup producer, a component must simply implement interface org.apache. wicket.markup.IMarkupResourceStreamProvider. The only method defined in this interface is getMarkupResourceStream(MarkupContainer, Class&#60;?&#62;) which returns an utility interface called IResourceStream representing the actual markup.<p class="paragraph"/>In the following example we have a custom panel without a related markup file that generates a simple &#60;div&#62; tag as markup:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class AutoMarkupGenPanel <span class="java&#45;keyword">extends</span> Panel <span class="java&#45;keyword"
 >implements</span> IMarkupResourceStreamProvider &#123;
 	<span class="java&#45;keyword">public</span> AutoMarkupGenPanel(<span class="java&#45;object">String</span> id, IModel&#60;?&#62; model) &#123;
 		<span class="java&#45;keyword">super</span>(id, model);		
@@ -322,16 +325,16 @@ IEventSource exposes a single method nam
 &#125;</pre></div>
 
 
-<h2 id="chapter16_6">16.6 Summary</h2>
+<h2 id="chapter16_6">17.6 Summary</h2>
 <p class="paragraph"/>In this chapter we have introduced some advanced topics we didn't have the chance to cover yet. We have started talking about behaviors and we have seen how they can be used to enrich existing components (promoting a component-oriented approach). Behaviors are also fundamental to work with AJAX in Wicket, as we will see in the next chapter.<p class="paragraph"/>After behaviors we have learnt how to generate callback URLs to execute a custom method on server side defined inside a specific callback interface.<p class="paragraph"/>The third topic of the chapter has been the event infrastructure provided in Wicket for inter-component communication which brings to our components a desktop-like event-driven architecture.<p class="paragraph"/>Then, we have introduced a new entity called initializer which can be used to configure resources and component in a modular and self-contained way.<p class="paragraph"/>We have also looked at Wicket support for JMX and we have s
 een how to use this technology for monitoring and managing our running applications.<p class="paragraph"/>Finally we have introduced a new technique to generate the markup of a component from its Java code.<p class="paragraph"/><p class="paragraph"/>
 
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter15.html">&lt;&lt; <strong>15</strong><span>An example of integration with JavaScript</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter15.html">&lt;&lt; <strong>16</strong><span>An example of integration with JavaScript</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter17.html"><strong>17</strong><span>Working with AJAX</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter17.html"><strong>18</strong><span>Working with AJAX</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>

Modified: wicket/common/site/trunk/_site/guide/guide/chapter17.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter17.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter17.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter17.html Mon Nov 11 22:13:12 2013
@@ -2,7 +2,7 @@
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <title>17 Working with AJAX 6.x</title>
+    <title>18 Working with AJAX 6.x</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
     <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
@@ -27,79 +27,82 @@ function addJsClass() {
                     <div class="toc-item" style="margin-left:0"><a href="../guide/chapter1.html"><strong>1</strong><span>Introduction</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>2</strong><span>Why should I learn Wicket?</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/howToSource.html"><strong>2</strong><span>How to use the example code</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>3</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>3</strong><span>Why should I learn Wicket?</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>4</strong><span>Wicket as page layout manager</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>4</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>5</strong><span>Keeping control over HTML</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>5</strong><span>Wicket as page layout manager</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>6</strong><span>Components lifecycle</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>6</strong><span>Keeping control over HTML</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>7</strong><span>Page versioning and caching</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>7</strong><span>Components lifecycle</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>8</strong><span>Under the hood of the request processing</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>8</strong><span>Page versioning and caching</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>9</strong><span>Wicket Links and URL generation</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>9</strong><span>Under the hood of the request processing</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>10</strong><span>Wicket models and forms</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>10</strong><span>Wicket Links and URL generation</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>11</strong><span>Wicket forms in detail</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>11</strong><span>Wicket models and forms</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>12</strong><span>Displaying multiple items with repeaters</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>12</strong><span>Wicket forms in detail</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>13</strong><span>Internationalization with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>13</strong><span>Displaying multiple items with repeaters</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>14</strong><span>Resource management with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>14</strong><span>Internationalization with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>15</strong><span>An example of integration with JavaScript</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>15</strong><span>Resource management with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>16</strong><span>Wicket advanced topics</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>16</strong><span>An example of integration with JavaScript</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>17</strong><span>Working with AJAX</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>17</strong><span>Wicket advanced topics</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>18</strong><span>Integration with enterprise containers</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>18</strong><span>Working with AJAX</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>19</strong><span>Security with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>19</strong><span>Integration with enterprise containers</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>20</strong><span>Test Driven Development with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>20</strong><span>Security with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>21</strong><span>Test Driven Development with Wicket and Spring</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>21</strong><span>Test Driven Development with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>22</strong><span>Wicket Best Practices</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>22</strong><span>Test Driven Development with Wicket and Spring</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>23</strong><span>Working with Maven (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>23</strong><span>Wicket Best Practices</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>24</strong><span>Project WicketStuff (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>24</strong><span>Working with Maven (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>25</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>25</strong><span>Project WicketStuff (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>26</strong><span>Contributing to this guide (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>26</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>27</strong><span>Contributing to this guide (Appendix)</span></a>
                     </div>
                     
                 </div>
@@ -129,18 +132,18 @@ function addJsClass() {
             <div id="main" class="corner-all">
 
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter16.html">&lt;&lt; <strong>16</strong><span>Wicket advanced topics</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter16.html">&lt;&lt; <strong>17</strong><span>Wicket advanced topics</span></a></div>
                 
 
                 <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
 
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter18.html"><strong>18</strong><span>Integration with enterprise containers</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter18.html"><strong>19</strong><span>Integration with enterprise containers</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>17 Working with AJAX - Reference Documentation</h1>
+                    <h1>18 Working with AJAX - Reference Documentation</h1>
 
                     <p><strong>Authors:</strong> Andrea Del Bene, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul Borș</p>
 
@@ -153,25 +156,25 @@ function addJsClass() {
                 <div id="table-of-content">
                     <h2>Table of Contents</h2>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_1"><strong>17.1</strong><span>How to use AJAX components and behaviors</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_1"><strong>18.1</strong><span>How to use AJAX components and behaviors</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_2"><strong>17.2</strong><span>Build-in AJAX components</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_2"><strong>18.2</strong><span>Build-in AJAX components</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_3"><strong>17.3</strong><span>Built-in AJAX behaviors</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_3"><strong>18.3</strong><span>Built-in AJAX behaviors</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_4"><strong>17.4</strong><span>Using an activity indicator</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_4"><strong>18.4</strong><span>Using an activity indicator</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_5"><strong>17.5</strong><span>AJAX request attributes and call listeners</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_5"><strong>18.5</strong><span>AJAX request attributes and call listeners</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_6"><strong>17.6</strong><span>Creating custom AJAX call listener</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_6"><strong>18.6</strong><span>Creating custom AJAX call listener</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_7"><strong>17.7</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter17_7"><strong>18.7</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -179,11 +182,11 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter17">17 Working with AJAX</h1>
+<h1 id="chapter17">18 Working with AJAX</h1>
 AJAX has become a must-have for nearly all kinds of web application. This technology does not only help to achieve a better user experience but it also allows to improve the bandwidth performance of web applications. Using AJAX usually means writing tons of JavaScript code to handle asynchronous requests and to update user interface, but with Wicket we can leave all this boilerplate code to the framework and we don't even need to write a single line of JavaScript to start using AJAX.<p class="paragraph"/>In this chapter we will learn how to leverage the AJAX support provided by Wicket to make our applications fully <a href="http://en.wikipedia.org/wiki/Web_2.0" target="blank">Web 2.0</a> compliant.
 
 
-<h2 id="chapter17_1">17.1 How to use AJAX components and behaviors</h2>
+<h2 id="chapter17_1">18.1 How to use AJAX components and behaviors</h2>
 <p class="paragraph"/>Wicket support for AJAX is implemented in file wicket-ajax-jquery.js which makes complete transparent to Java code any detail about AJAX communication.<p class="paragraph"/>AJAX components and behaviors shipped with Wicket expose one or more callback methods which are executed when they receive an AJAX request. One of the arguments of these methods is an instance of interface org.apache.wicket.ajax.AjaxRequestTarget.<p class="paragraph"/>For example component AjaxLink (in package org.apache.wicket.ajax.markup.html) defines abstract method onClick(AjaxRequestTarget target) which is executed when user clicks on the component:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">new</span> AjaxLink(<span class="java&#45;quote">"ajaxLink"</span>)&#123;
 	@Override
 	<span class="java&#45;keyword">public</span> void onClick(AjaxRequestTarget target) &#123;
@@ -218,7 +221,7 @@ Repeaters component that have org.apache
 </blockquote>
 
 
-<h2 id="chapter17_2">17.2 Build-in AJAX components</h2>
+<h2 id="chapter17_2">18.2 Build-in AJAX components</h2>
 <p class="paragraph"/>Wicket distribution comes with a number of built-in AJAX components ready to be used. Some of them are the ajaxified version of common components like links and buttons, while others are AJAX-specific components.<p class="paragraph"/>AJAX components are not different from any other component seen so far and they don't require any additional configuration to be used. As we will shortly see, switching from a classic link or button to the ajaxified version is just a matter of appending “Ajax” to the component class name.<p class="paragraph"/>This paragraph provides an overview of what we can find in Wicket to start writing AJAX-enhanced web applications.<p class="paragraph"/><h3>Links and buttons</h3><p class="paragraph"/>In the previous paragraph we have already introduced component AjaxLink. Wicket provides also the ajaxified versions of submitting components SubmitLink and Button which are simply called AjaxSubmitLink and AjaxButton. These components 
 come with a version of methods onSubmit, onError and onAfterSubmit that takes in input also an instance of AjaxRequestTarget.<p class="paragraph"/>Both components are in package org.apache.wicket.ajax.markup.html.form.<p class="paragraph"/><h3>Fallback components</h3><p class="paragraph"/>Building an entire site using AJAX can be risky as some clients may not support this technology. In order to provide an usable version of our site also to these clients, we can use components AjaxFallbackLink and AjaxFallbackButton which are able to automatically degrade to a standard link or to a standard button if client doesn't support AJAX.<p class="paragraph"/><h3>AJAX Checkbox</h3><p class="paragraph"/>Class org.apache.wicket.ajax.markup.html.form.AjaxCheckBox is a checkbox component that updates its model via AJAX when user changes its value. Its AJAX callback method is onUpdate(AjaxRequestTarget target). The component extends standard checkbox component CheckBox adding an AjaxFormComponentU
 pdatingBehavior to itself (we will see this behavior later in paragraph 16.3.3).<p class="paragraph"/><h3>AJAX editable labels</h3><p class="paragraph"/>An editable label is a special label that can be edited by the user when she/he clicks on it. Wicket ships three different implementations for this component (all inside package org.apache.wicket. extensions.ajax.markup.html):
 <ul class="star">
 <li><strong class="bold">AjaxEditableLabel</strong>: it's a basic version of editable label. User can edit the content of the label with a text field. This is also the base class for the other two editable labels.</li>
@@ -364,7 +367,7 @@ add(label);
 
 
 
-<h2 id="chapter17_3">17.3 Built-in AJAX behaviors</h2>
+<h2 id="chapter17_3">18.3 Built-in AJAX behaviors</h2>
 <p class="paragraph"/>In addition to specific components, Wicket offers also a set of built in AJAX behaviors that can be used to easily add AJAX functionalities to existing components. As we will see in this paragraph AJAX behaviors can be used also to ajaxify components that weren't initially designed to work with this technology. All the following behaviors are inside package org.apache.wicket.ajax.<p class="paragraph"/><h3>AjaxEventBehavior</h3><p class="paragraph"/>AjaxEventBehavior allows to handle a JavaScript event (like click, change, etc...) on server side via AJAX. Its constructor takes in input the name of the event that must be handled. Every time this event is fired for a given component on client side, the callback method onEvent(AjaxRequestTarget target) is executed. onEvent is abstract, hence we must implement it to tell AjaxEventBehavior what to do when the specified event occurs.<p class="paragraph"/>In project AjaxEventBehaviorExample we used this behavior to bui
 ld a “clickable” Label component that counts the number of clicks. Here is the code from the home page of the project:<p class="paragraph"/><strong class="bold">HTML:</strong>
 <div class="code"><pre>&#60;body&#62;
   &#60;div wicket:id=<span class="java&#45;quote">"clickCounterLabel"</span>&#62;&#60;/div&#62;
@@ -418,7 +421,7 @@ dynamicLabel.add(<span class="java&#45;k
 add(dynamicLabel);</pre></div>
 
 
-<h2 id="chapter17_4">17.4 Using an activity indicator</h2>
+<h2 id="chapter17_4">18.4 Using an activity indicator</h2>
 <p class="paragraph"/>One of the things we must take care of when we use AJAX is to notify user when an AJAX request is already in progress. This is usually done displaying an animated picture as activity indicator while the AJAX request is running.<p class="paragraph"/>Wicket comes with a variant of components AjaxButton, AjaxLink and AjaxFallbackLink that display a default activity indicator during AJAX request processing. These components are respectively  IndicatingAjaxButton, IndicatingAjaxLink and IndicatingAjaxFallbackLink.<p class="paragraph"/>The default activity indicator used in Wicket can be easily integrated in our components using behavior AjaxIndicatorAppender (available in package org.apache.wicket.extensions.ajax. markup.html) and implementing the interface IAjaxIndicatorAware (in package org.apache. wicket.ajax).<p class="paragraph"/>IAjaxIndicatorAware declares method getAjaxIndicatorMarkupId() which returns the id of the markup element used to display the activit
 y indicator. This id can be obtained from the AjaxIndicatorAppender behavior that has been added to the current component. The following code snippet summarizes the steps needed to integrate the default activity indicator with an ajaxified component:<p class="paragraph"/><div class="code"><pre>//1&#45;Implement <span class="java&#45;keyword">interface</span> IAjaxIndicatorAware
 <span class="java&#45;keyword">public</span> class MyComponent <span class="java&#45;keyword">extends</span> Component <span class="java&#45;keyword">implements</span> IAjaxIndicatorAware &#123;
 	//2&#45;Instantiate an AjaxIndicatorAppender
@@ -436,7 +439,7 @@ add(dynamicLabel);</pre></div>
 &#125;</pre></div><p class="paragraph"/>If we need to change the default picture used as activity indicator, we can override method getIndicatorUrl() of AjaxIndicatorAppender and return the URL to the desired picture.
 
 
-<h2 id="chapter17_5">17.5 AJAX request attributes and call listeners</h2>
+<h2 id="chapter17_5">18.5 AJAX request attributes and call listeners</h2>
 <p class="paragraph"/>Starting from version 6.0 Wicket has introduced two entities which allow us to control how an AJAX request is generated on client side and to specify the custom JavaScript code we want to execute during request handling. These entities are class AjaxRequestAttributes and interface IAjaxCallListener, both placed in package org.apache.wicket.ajax.attributes.<p class="paragraph"/>AjaxRequestAttributes exposes the attributes used to generate the JavaScript call invoked on client side to start an AJAX request. Each attribute will be passed as a <a href="http://en.wikipedia.org/wiki/JSON" target="blank">JSON</a> parameter to the JavaScript function Wicket.Ajax.ajax which is responsible for sending the concrete AJAX request. Every JSON parameter is identified by a short name. Here is a partial list of the available parameters:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Short name</strong></th>
 <th><strong class="bold">Description</strong></th><th><strong class="bold">Default value</strong></th></tr><tr class="table-odd"><td>u</td><td>The callback URL used to serve the AJAX request that will be sent.</td><td>&#160;</td></tr><tr class="table-even"><td>c</td><td>The id of the component that wants to start the AJAX call.</td><td>&#160;</td></tr><tr class="table-odd"><td>e</td><td>A list of event (click, change, etc...) that can trigger the AJAX call.</td><td>domready</td></tr><tr class="table-even"><td>m</td><td>The request method that must be used (GET or POST).</td><td>GET</td></tr><tr class="table-odd"><td>f</td><td>The id of the form that must be submitted with the AJAX call.</td><td>&#160;</td></tr><tr class="table-even"><td>mp</td><td>If the AJAX call involves the submission of a form, this flag indicates whether the data must be encoded using the encoding mode “multipart/form-data”.</td><td>false</td></tr><tr class="table-odd"><td>sc</td><td>The input name of
  the submitting component of the form</td><td>&#160;</td></tr><tr class="table-even"><td>async</td><td>A boolean parameter that indicates if the AJAX call is asynchronous (true) or not.</td><td>true</td></tr><tr class="table-odd"><td>wr</td><td>Specifies the type of data returned by the AJAX call (XML, HTML, JSON, etc...).</td><td>XML</td></tr><tr class="table-even"><td>bh, pre, bsh, ah, sh, fh, coh</td><td>This is a list of the listeners that are executed on client side (they are JavaScript scripts) during the lifecycle of an AJAX request. Each short name is the abbreviation of one of the methods defined in the interface IAjaxCallListener (see below).</td><td>An empty list</td></tr></table><p class="paragraph"/><blockquote class="note">
 A full list of the available request parameters as well as more details on the related JavaScript code can be found at <a href="https://cwiki.apache.org/confluence/" target="blank">https://cwiki.apache.org/confluence/ display/WICKET/Wicket+Ajax</a> display/WICKET/Wicket+Ajax .
 </blockquote><p class="paragraph"/>Parameters 'u' (callback URL) and 'c' (the id of the component) are generated by the AJAX behavior that will serve the AJAX call and they are not accessible through AjaxRequestAttributes.<p class="paragraph"/>Here is the final AJAX function generate for the behavior used in example project AjaxEventBehavior Example:<p class="paragraph"/><div class="code"><pre>Wicket.Ajax.ajax(&#123;<span class="java&#45;quote">"u"</span>:<span class="java&#45;quote">"./?0&#45;1.IBehaviorListener.0&#45;clickCounterLabel"</span>, <span class="java&#45;quote">"e"</span>:<span class="java&#45;quote">"click"</span>,               
@@ -463,7 +466,7 @@ A full list of the available request par
 
 
 
-<h2 id="chapter17_6">17.6 Creating custom AJAX call listener</h2>
+<h2 id="chapter17_6">18.6 Creating custom AJAX call listener</h2>
 <p class="paragraph"/>Displaying an activity indicator is a nice way to notify user that an AJAX request is already running, but sometimes is not enough. In some situations we may need to completely disable a component during AJAX request processing, for example when we want to avoid that impatient users submit a form multiple times. In this paragraph we will see how to accomplish this goal building a custom and reusable IAjaxCallListener. The code used in this example is from project CustomAjaxListenerExample.<p class="paragraph"/><h3>What we want for our listener</h3><p class="paragraph"/>The listener should execute some JavaScript code to disable a given component when the component it is attached to is about to make an AJAX call. Then, when the AJAX request has been completed, the listener should bring back the disabled component to an active state.<p class="paragraph"/>When a component is disabled it must be clear to user that an AJAX request is running and that he/she must wai
 t for it to complete. To achieve this result we want to disable a given component covering it with a semi-transparent overlay area with an activity indicator in the middle.<p class="paragraph"/>The final result will look like this:<p class="paragraph"/><img border="0" class="center" src="../img/custom-ajax-call-listener.png"></img><p class="paragraph"/><h3>How to implement the listener</h3><p class="paragraph"/>The listener will implement methods getBeforeHandler and getAfterHandler: the first will return the code needed to place an overlay &#60;div&#62; on the desired component while the second must remove this overlay when the AJAX call has completed.<p class="paragraph"/>To move and resize the overlay area we will use another module from <a href="http://jqueryui.com/position/" target="blank">JQueryUI library</a> that allows us to position DOM elements on our page relative to another element.<p class="paragraph"/>So our listener will depend on four static resources: the JQuery lib
 rary, the position module of JQuery UI, the custom code used to move the overlay &#60;div&#62; and the picture used as activity indicator. Except for the activity indicator, all these resources must be added to page header section in order to be used.<p class="paragraph"/>Ajax call listeners can contribute to header section by simply implementing interface IComponentAwareHeaderContributor. Wicket provides adapter class AjaxCallListener that implements both IAjaxCallListener and IComponentAwareHeaderContributor. We will use this class as base class for our listener.<p class="paragraph"/><h3>JavaScript code</h3><p class="paragraph"/>Now that we know what to do on the Java side, let's have a look at the custom JavaScript code that must be returned by our listener (file moveHiderAndIndicator.js):<p class="paragraph"/><div class="code"><pre>DisableComponentListener = &#123;
    disableElement: function(elementId, activeIconUrl)&#123;
       <span class="java&#45;keyword">var</span> hiderId = elementId + <span class="java&#45;quote">"&#45;disable&#45;layer"</span>;
@@ -547,16 +550,16 @@ A full list of the available request par
 
 
 
-<h2 id="chapter17_7">17.7 Summary</h2>
+<h2 id="chapter17_7">18.7 Summary</h2>
 <p class="paragraph"/>AJAX is another example of how Wicket can simplify web technologies providing a good component and object oriented abstraction of them.<p class="paragraph"/>In this chapter we have seen how to take advantage of the AJAX support provided by Wicket to write AJAX-enhanced applications. Most of the chapter has been dedicated to the built-in components and behaviors that let us adopt AJAX without almost any effort.<p class="paragraph"/>In the final part of the chapter we have seen how Wicket physically implements an AJAX call on client side using AJAX request attributes. Then, we have learnt how to use call listeners to execute custom JavaScript during AJAX request lifecycle.
 
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter16.html">&lt;&lt; <strong>16</strong><span>Wicket advanced topics</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter16.html">&lt;&lt; <strong>17</strong><span>Wicket advanced topics</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter18.html"><strong>18</strong><span>Integration with enterprise containers</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter18.html"><strong>19</strong><span>Integration with enterprise containers</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>

Modified: wicket/common/site/trunk/_site/guide/guide/chapter18.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter18.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter18.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter18.html Mon Nov 11 22:13:12 2013
@@ -2,7 +2,7 @@
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <title>18 Integration with enterprise containers 6.x</title>
+    <title>19 Integration with enterprise containers 6.x</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
     <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
@@ -27,79 +27,82 @@ function addJsClass() {
                     <div class="toc-item" style="margin-left:0"><a href="../guide/chapter1.html"><strong>1</strong><span>Introduction</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>2</strong><span>Why should I learn Wicket?</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/howToSource.html"><strong>2</strong><span>How to use the example code</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>3</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter2.html"><strong>3</strong><span>Why should I learn Wicket?</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>4</strong><span>Wicket as page layout manager</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter3.html"><strong>4</strong><span>Wicket says &ldquo;Hello world!&rdquo;</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>5</strong><span>Keeping control over HTML</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter4.html"><strong>5</strong><span>Wicket as page layout manager</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>6</strong><span>Components lifecycle</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter5.html"><strong>6</strong><span>Keeping control over HTML</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>7</strong><span>Page versioning and caching</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter6.html"><strong>7</strong><span>Components lifecycle</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>8</strong><span>Under the hood of the request processing</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter7.html"><strong>8</strong><span>Page versioning and caching</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>9</strong><span>Wicket Links and URL generation</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter8.html"><strong>9</strong><span>Under the hood of the request processing</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>10</strong><span>Wicket models and forms</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter9.html"><strong>10</strong><span>Wicket Links and URL generation</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>11</strong><span>Wicket forms in detail</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter10.html"><strong>11</strong><span>Wicket models and forms</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>12</strong><span>Displaying multiple items with repeaters</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter11.html"><strong>12</strong><span>Wicket forms in detail</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>13</strong><span>Internationalization with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter12.html"><strong>13</strong><span>Displaying multiple items with repeaters</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>14</strong><span>Resource management with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter13.html"><strong>14</strong><span>Internationalization with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>15</strong><span>An example of integration with JavaScript</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter14.html"><strong>15</strong><span>Resource management with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>16</strong><span>Wicket advanced topics</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter15.html"><strong>16</strong><span>An example of integration with JavaScript</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>17</strong><span>Working with AJAX</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter16.html"><strong>17</strong><span>Wicket advanced topics</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>18</strong><span>Integration with enterprise containers</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter17.html"><strong>18</strong><span>Working with AJAX</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>19</strong><span>Security with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter18.html"><strong>19</strong><span>Integration with enterprise containers</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>20</strong><span>Test Driven Development with Wicket</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter19.html"><strong>20</strong><span>Security with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>21</strong><span>Test Driven Development with Wicket and Spring</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter20.html"><strong>21</strong><span>Test Driven Development with Wicket</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>22</strong><span>Wicket Best Practices</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter21.html"><strong>22</strong><span>Test Driven Development with Wicket and Spring</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>23</strong><span>Working with Maven (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter22.html"><strong>23</strong><span>Wicket Best Practices</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>24</strong><span>Project WicketStuff (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter23.html"><strong>24</strong><span>Working with Maven (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>25</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter24.html"><strong>25</strong><span>Project WicketStuff (Appendix)</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>26</strong><span>Contributing to this guide (Appendix)</span></a>
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter25.html"><strong>26</strong><span>Lost In Redirection With Apache Wicket (Appendix)</span></a>
+                    </div>
+                    
+                    <div class="toc-item" style="margin-left:0"><a href="../guide/chapter26.html"><strong>27</strong><span>Contributing to this guide (Appendix)</span></a>
                     </div>
                     
                 </div>
@@ -129,18 +132,18 @@ function addJsClass() {
             <div id="main" class="corner-all">
 
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter17.html">&lt;&lt; <strong>17</strong><span>Working with AJAX</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter17.html">&lt;&lt; <strong>18</strong><span>Working with AJAX</span></a></div>
                 
 
                 <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
 
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter19.html"><strong>19</strong><span>Security with Wicket</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter19.html"><strong>20</strong><span>Security with Wicket</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>18 Integration with enterprise containers - Reference Documentation</h1>
+                    <h1>19 Integration with enterprise containers - Reference Documentation</h1>
 
                     <p><strong>Authors:</strong> Andrea Del Bene, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul Borș</p>
 
@@ -153,16 +156,16 @@ function addJsClass() {
                 <div id="table-of-content">
                     <h2>Table of Contents</h2>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_1"><strong>18.1</strong><span>Integrating Wicket with EJB</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_1"><strong>19.1</strong><span>Integrating Wicket with EJB</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_2"><strong>18.2</strong><span>Integrating Wicket with Spring</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_2"><strong>19.2</strong><span>Integrating Wicket with Spring</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_3"><strong>18.3</strong><span>JSR-330 annotations</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_3"><strong>19.3</strong><span>JSR-330 annotations</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_4"><strong>18.4</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter18_4"><strong>19.4</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -170,11 +173,11 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter18">18 Integration with enterprise containers</h1>
+<h1 id="chapter18">19 Integration with enterprise containers</h1>
 Writing a web application is not just about producing a good layout and a bunch of “cool” pages. We must also integrate our presentation code with enterprise resources like data sources, message queues, business objects, etc...<p class="paragraph"/>The first decade of 2000s has seen the rising of new frameworks (like <a href="http://www.springsource.org/" target="blank">Spring</a> ) and new specifications (like <a href="http://en.wikipedia.org/wiki/Enterprise_JavaBeans" target="blank">EJB 3.1</a> ) aimed to simplify the management of enterprise resources and (among other things) their integration with presentation code.<p class="paragraph"/>All these new technologies are based on the concepts of container and dependency injection. Container is the environment where our enterprise resources are created and configured while  <a href="http://en.wikipedia.org/wiki/Dependency_Injection" target="blank">dependency injection</a> is a pattern implemented by containers to inject int
 o an object the resources it depends on.<p class="paragraph"/>Wicket can be easily integrated with enterprise containers using component instantiation listeners. These entities are instances of interface org.apache.wicket.application.IComponent InstantiationListener and can be registered during application's initialization.   IComponentInstantiationListener defines callback method onInstantiation(Component component) which can be used to provide custom instantiation logic for Wicket components.<p class="paragraph"/>Wicket distribution and project <a href="https://github.com/wicketstuff" target="blank">WicketStuff</a> already provide a set of built-in listeners to integrate our applications with EJB 3.1 compliant containers (like JBoss Seam) or with some of the most popular enterprise frameworks like <a href="http://code.google.com/p/google-guice/" target="blank">Guice</a> or Spring.<p class="paragraph"/>In this chapter we will see two basic examples of injecting a container-defined 
 object into a page using first an implementation of the EJB 3.1 specifications (project <a href="http://openejb.apache.org/" target="blank">OpenEJB</a> ) and then using Spring.
 
 
-<h2 id="chapter18_1">18.1 Integrating Wicket with EJB</h2>
+<h2 id="chapter18_1">19.1 Integrating Wicket with EJB</h2>
 <p class="paragraph"/>WicketStuff provides a module called wicketstuff-javaee-inject that contains component instantiation listener JavaEEComponentInjector. If we register this listener in our application we can use standard EJB annotations to inject dependencies into our Wicket components.<p class="paragraph"/>To register a component instantiation listener in Wicket we must use Application's method getComponentInstantiationListeners which returns a typed collection of IComponent InstantiationListeners.<p class="paragraph"/>The following initialization code is taken from project EjbInjectionExample:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class WicketApplication <span class="java&#45;keyword">extends</span> WebApplication
 &#123;    	
        //Constructor...<p class="paragraph"/>	@Override
@@ -194,7 +197,7 @@ Writing a web application is not just ab
 &#125;</pre></div><p class="paragraph"/>That is all. We can point the browser to the home page of the project and see the greeting message injected into the page:<p class="paragraph"/><img border="0" class="center" src="../img/EjbInjectionExample.png"></img>
 
 
-<h2 id="chapter18_2">18.2 Integrating Wicket with Spring</h2>
+<h2 id="chapter18_2">19.2 Integrating Wicket with Spring</h2>
 <p class="paragraph"/>If we need to inject dependencies with Spring we can use listener org.apache.wicket.spring. injection.annot.SpringComponentInjector provided by module wicket-spring.<p class="paragraph"/>For the sake of simplicity in the example project SpringInjectionExample we have used Spring class AnnotationConfigApplicationContext to avoid any XML file and create a Spring context directly from code:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class WicketApplication <span class="java&#45;keyword">extends</span> WebApplication
 &#123;      
   //Constructor...<p class="paragraph"/>  @Override
@@ -219,22 +222,22 @@ Writing a web application is not just ab
   <span class="java&#45;keyword">private</span> EnterpriseMessage enterpriseMessage;</pre></div>
 
 
-<h2 id="chapter18_3">18.3 JSR-330 annotations</h2>
+<h2 id="chapter18_3">19.3 JSR-330 annotations</h2>
 <p class="paragraph"/>Spring (and Guice) users can use standard <a href="http://jcp.org/en/jsr/detail?id=330" target="blank">JSR-330</a> annotations to wire their dependencies. This will make their code more interoperable with other containers that support this standard:<p class="paragraph"/><div class="code"><pre>//inject a bean specifying its name with JSR&#45;330 annotations
   <code>Inject </code>Named(<span class="java&#45;quote">"anotherName"</span>)
   <span class="java&#45;keyword">private</span> EnterpriseMessage enterpriseMessage;</pre></div>
 
 
-<h2 id="chapter18_4">18.4 Summary</h2>
+<h2 id="chapter18_4">19.4 Summary</h2>
 <p class="paragraph"/>In this chapter we have seen how to integrate Wicket applications with Spring and with an EJB container. Module wicket-examples contains also an example of integration with Guice (see application class org.apache.wicket.examples.guice.GuiceApplication).<p class="paragraph"/>
 
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter17.html">&lt;&lt; <strong>17</strong><span>Working with AJAX</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter17.html">&lt;&lt; <strong>18</strong><span>Working with AJAX</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter19.html"><strong>19</strong><span>Security with Wicket</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter19.html"><strong>20</strong><span>Security with Wicket</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>