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 [8/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/chapter5.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter5.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter5.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter5.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>5 Keeping control over HTML 6.x</title>
+    <title>6 Keeping control over HTML 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/chapter4.html">&lt;&lt; <strong>4</strong><span>Wicket as page layout manager</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter4.html">&lt;&lt; <strong>5</strong><span>Wicket as page layout manager</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/chapter6.html"><strong>6</strong><span>Components lifecycle</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter6.html"><strong>7</strong><span>Components lifecycle</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>5 Keeping control over HTML - Reference Documentation</h1>
+                    <h1>6 Keeping control over HTML - Reference Documentation</h1>
 
                     <p><strong>Authors:</strong> Andrea Del Bene, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul Borș</p>
 
@@ -153,37 +156,37 @@ function addJsClass() {
                 <div id="table-of-content">
                     <h2>Table of Contents</h2>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_1"><strong>5.1</strong><span>Hiding or disabling a component</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_1"><strong>6.1</strong><span>Hiding or disabling a component</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_2"><strong>5.2</strong><span>Modifing tag attributes</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_2"><strong>6.2</strong><span>Modifing tag attributes</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_3"><strong>5.3</strong><span>Generating tag attribute 'id'</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_3"><strong>6.3</strong><span>Generating tag attribute 'id'</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_4"><strong>5.4</strong><span>Creating in-line panels with WebMarkupContainer</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_4"><strong>6.4</strong><span>Creating in-line panels with WebMarkupContainer</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_5"><strong>5.5</strong><span>Working with markup fragments</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_5"><strong>6.5</strong><span>Working with markup fragments</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_6"><strong>5.6</strong><span>Adding header contents to the final page</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_6"><strong>6.6</strong><span>Adding header contents to the final page</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_7"><strong>5.7</strong><span>Using stub markup in our pages/panels</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_7"><strong>6.7</strong><span>Using stub markup in our pages/panels</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_8"><strong>5.8</strong><span>How to render component body only</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_8"><strong>6.8</strong><span>How to render component body only</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_9"><strong>5.9</strong><span>Hiding decorating elements with the wicket:enclosure tag</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_9"><strong>6.9</strong><span>Hiding decorating elements with the wicket:enclosure tag</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_10"><strong>5.10</strong><span>Surrounding existing markup with Border</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_10"><strong>6.10</strong><span>Surrounding existing markup with Border</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_11"><strong>5.11</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter5_11"><strong>6.11</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -191,26 +194,26 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter5">5 Keeping control over HTML</h1>
+<h1 id="chapter5">6 Keeping control over HTML</h1>
 Many Wicket newbies are initially scared by its approach to web development because they have the impression that the component-oriented nature of the framework prevents them from having direct control over the generated markup. This is due to the fact that many developers come from other server-side technologies like JSP where we physically implement the logic that controls how the final HTML is generated.<p class="paragraph"/>This chapter will prevent you from having any initial misleading feeling about Wicket showing you how to control and manipulate the generated HTML with the built-in tools shipped with the framework.
 
 
-<h2 id="chapter5_1">5.1 Hiding or disabling a component</h2>
+<h2 id="chapter5_1">6.1 Hiding or disabling a component</h2>
 At the end of the previous chapter we have seen how to hide a component calling its method <code>setVisible</code>. In a similar fashion, we can also decide to disable a component using method <code>setEnabled</code>. When a component is disabled all the links inside it will be in turn disabled (they will be rendered as <code>&#60;span&#62;</code>) and it can not fire JavaScript events.<p class="paragraph"/>Class <code>Component</code> provides two getter methods to determinate if a component is visible or enabled: <code>isVisible</code> and <code>isEnabled</code>.<p class="paragraph"/>Even if nothing prevents us from overriding these two methods to implement a custom logic to determinate the state of a component, we should keep in mind that methods <code>isVisible</code> and <code>isEnabled</code> are called multiple times before a component is fully rendered. Hence, if we place non-trivial code inside these two methods, we can sensibly deteriorate the responsiveness of our pages.<
 p class="paragraph"/>As we will see in the next chapter, class <code>Component</code> provides method <code>onConfigure</code> which is more suited to contain code that contributes to determinate component states because it is called just once during rendering phase.
 
 
-<h2 id="chapter5_2">5.2 Modifing tag attributes</h2>
+<h2 id="chapter5_2">6.2 Modifing tag attributes</h2>
 To modify tag attributes we can use class <code>org.apache.wicket.AttributeModifier</code>. This class extends <code>org.apache.wicket.behavior.Behavior</code> and can be added to any component via the <code>Component</code>'s <code>add</code> method. Class <code>Behavior</code> is used to expand component functionalities and it can also modify component markup. We will see this class in detail later in <a href="../guide/single.html#chapter16_1" class="guide">chapter 16.1</a>.<p class="paragraph"/>As first example of attribute manipulation let's consider a <code>Label</code> component bound to the following markup:<p class="paragraph"/><div class="code"><pre>&#60;span wicket:id=<span class="java&#45;quote">"simpleLabel"</span>&#62;&#60;/span&#62;</pre></div><p class="paragraph"/>Suppose we want to add some style to label content making it red and bolded. We can add to the label an <code>AttributeModifier</code> which creates the tag attribute <code>style</code> with value <code>"col
 or:red;font-weight:bold"</code>:<p class="paragraph"/><div class="code"><pre>label.add(<span class="java&#45;keyword">new</span> AttributeModifier(<span class="java&#45;quote">"style"</span>, <span class="java&#45;quote">"color:red;font&#45;weight:bold"</span>));</pre></div><p class="paragraph"/>If attribute <code>style</code> already exists in the original markup, it will be replaced with the value specified by <code>AttributeModifier</code>. If we don't want to overwrite the existing value of an attribute we can use subclass <code>AttributeAppender</code> which will append its value to the existing one:<p class="paragraph"/><div class="code"><pre>label.add(<span class="java&#45;keyword">new</span> AttributeAppender(<span class="java&#45;quote">"style"</span>, <span class="java&#45;quote">"color:red;font&#45;weight:bold"</span>));</pre></div><p class="paragraph"/>We can also create attribute modifiers using factory methods provided by class <code>AttributeModifier</code> and it's a
 lso possible to prepend a given value to an existing attribute:<p class="paragraph"/><div class="code"><pre>//replaces existing value with the given one
 label.add(AttributeModifier.replace(<span class="java&#45;quote">"style"</span>, <span class="java&#45;quote">"color:red;font&#45;weight:bold"</span>));<p class="paragraph"/>//appends the given value to the existing one
 label.add(AttributeModifier.append(<span class="java&#45;quote">"style"</span>, <span class="java&#45;quote">"color:red;font&#45;weight:bold"</span>));<p class="paragraph"/>//prepends the given value to the existing one
 label.add(AttributeModifier.prepend(<span class="java&#45;quote">"style"</span>, <span class="java&#45;quote">"color:red;font&#45;weight:bold"</span>));</pre></div>
 
 
-<h2 id="chapter5_3">5.3 Generating tag attribute 'id'</h2>
+<h2 id="chapter5_3">6.3 Generating tag attribute 'id'</h2>
 Tag attribute <code>id</code> plays a crucial role in web development as it allows JavaScript to identify a DOM element. That's why class <code>Component</code> provides two dedicated methods to set this attribute. With method <code>setOutputMarkupId(boolean output)</code> we can decide if the <code>id</code> attribute will be rendered or not in the final markup (by default is not rendered). The value of this attribute will be automatically generated by Wicket and it will be unique for the entire page. If we need to specify this value by hand, we can use method <code>setMarkupId(String id)</code>. The value of the id can be retrieved with method <code>getMarkupId()</code>.
 
 
-<h2 id="chapter5_4">5.4 Creating in-line panels with WebMarkupContainer</h2>
+<h2 id="chapter5_4">6.4 Creating in-line panels with WebMarkupContainer</h2>
 Create custom panels is a great way to handle complex user interfaces. However, sometimes we may need to create a panel which is used only by a specific page and only for a specific task.<p class="paragraph"/>In situations like these component <code>org.apache.wicket.markup.html.WebMarkupContainer</code> is better suited than custom panels because it can be directly attached to a tag in the parent markup without needing a corresponding html file (hence it is less reusable). Let's consider for example the main page of a mail service where users can see a list of received mails. Suppose that this page shows a notification box where user can see if new messages have arrived. This box must be hidden if there are no messages to display and it would be nice if we could handle it as if it was a Wicket component.<p class="paragraph"/>Suppose also that this information box is a <code>&#60;div&#62;</code> tag like this inside the page:<p class="paragraph"/><div class="code"><pre>&#60;div wick
 et:id=<span class="java&#45;quote">"informationBox"</span>&#62;
    //here's the body
    You've got &#60;span wicket:id=<span class="java&#45;quote">"messagesNumber"</span>&#62;&#60;/span&#62; <span class="java&#45;keyword">new</span> messages.
@@ -221,7 +224,7 @@ add(informationBox);<p class="paragraph"
 informationBox.setVisible(<span class="java&#45;keyword">false</span>);</pre></div><p class="paragraph"/>As you can see in the snippet above we can handle our information box from Java code as we do with any other Wicket component.
 
 
-<h2 id="chapter5_5">5.5 Working with markup fragments</h2>
+<h2 id="chapter5_5">6.5 Working with markup fragments</h2>
 Another circumstance in which we may prefer to avoid the creation of custom panels is when we want to conditionally display in a page small fragments of markup. In this case if we decided to use panels, we would end up having a huge number of small panel classes with their related markup file.<p class="paragraph"/>To better cope with situations like this, Wicket defines component <code>Fragment</code> in package <code>org. apache.wicket.markup.html.panel</code>. Just like its parent component <code>WebMarkupContainer</code>, Fragment doesn't have its own markup file but it uses a markup fragment defined in the markup file of its parent container, which can be a page or a panel. The fragment must be delimited with tag <code>&#60;wicket:fragment&#62;</code> and must be identified by a <code>wicket:id</code> attribute. In addition to the component id, <code>Fragment</code>'s constructor takes as input also the id of the fragment and a reference to its container.<p class="paragraph"/>In
  the following  example we have defined a fragment in a page and we used it as content area:<p class="paragraph"/><strong class="bold">Page markup:</strong><p class="paragraph"/><div class="code"><pre>&#60;html&#62;
   &#8230;
 &#60;body&#62;
@@ -248,7 +251,7 @@ Fragment fragment = <span class="java&#4
 replace(fragment);</pre></div>
 
 
-<h2 id="chapter5_6">5.6 Adding header contents to the final page</h2>
+<h2 id="chapter5_6">6.6 Adding header contents to the final page</h2>
 Panel's markup can also contain HTML tags which must go inside header section of the final page, like tags <code>&#60;script&#62;</code> or <code>&#60;style&#62;</code>. To tell Wicket to put these tags inside page <code>&#60;head&#62;</code>, we must surround them with the <code>&#60;wicket:head&#62;</code> tag.<p class="paragraph"/>Considering the markup of a generic panel, we can use <code>&#60;wicket:head&#62;</code> tag in this way:<p class="paragraph"/>{html}
 &#60;wicket:head&#62;
 	&#60;script type="text/javascript"&#62;
@@ -273,7 +276,7 @@ The <code>&#60;wicket:head&#62;</code> t
 </blockquote>
 
 
-<h2 id="chapter5_7">5.7 Using stub markup in our pages/panels</h2>
+<h2 id="chapter5_7">6.7 Using stub markup in our pages/panels</h2>
 Wicket's <code>&#60;wicket:remove&#62;</code> tag can be very useful when our web designer needs to show us how a page or a panel should look like. The markup inside this tag will be stripped out in the final page, so it's the ideal place for web designers to put their stub markup:<p class="paragraph"/><div class="code"><pre>&#60;html&#62;
 &#60;head&#62;<p class="paragraph"/>&#60;/head&#62;
 &#60;body&#62;
@@ -284,7 +287,7 @@ Wicket's <code>&#60;wicket:remove&#62;</
 &#60;/html&#62;</pre></div>
 
 
-<h2 id="chapter5_8">5.8 How to render component body only</h2>
+<h2 id="chapter5_8">6.8 How to render component body only</h2>
 When we bind a component to its corresponding tag we can choose to get rid of this outer tag in the final markup. If we call method <code>setRenderBodyOnly(true)</code> on a component Wicket will remove the surrounding tag.<p class="paragraph"/>For example given the following markup and code:<p class="paragraph"/><strong class="bold">HTML markup:</strong><p class="paragraph"/><div class="code"><pre>&#60;html&#62;
 &#60;head&#62;
   &#60;title&#62;Hello world page&#60;/title&#62;
@@ -304,7 +307,7 @@ add(label);</pre></div><p class="paragra
 &#60;/html&#62;</pre></div><p class="paragraph"/>As you can see the <code>&#60;div&#62;</code> tag used for component <code>Label</code> is not present in the final markup.
 
 
-<h2 id="chapter5_9">5.9 Hiding decorating elements with the wicket:enclosure tag</h2>
+<h2 id="chapter5_9">6.9 Hiding decorating elements with the wicket:enclosure tag</h2>
 Our data are rarely displayed alone without a caption or other graphic elements that make clear the meaning of their value. For example:<p class="paragraph"/><div class="code"><pre>&#60;label&#62;Total amount: &#60;/label&#62;&#60;span wicket:id=<span class="java&#45;quote">"totalAmount"</span>&#62;&#60;/span&#62;</pre></div><p class="paragraph"/>Wicket comes with a nice utility tag called <code>&#60;wicket:enclosure&#62;</code> that automatically hides those decorating elements if the related data value is not visible. All we have to do is to put the involved markup inside this tag. Applying <code>&#60;wicket:enclosure&#62;</code> to the previous example we get the following markup:<p class="paragraph"/><div class="code"><pre>&#60;wicket:enclosure&#62; 
     &#60;label&#62;Total amount: &#60;/label&#62;&#60;span wicket:id=<span class="java&#45;quote">"totalAmount"</span>&#62;&#60;/span&#62;
 &#60;/wicket:enclosure&#62;</pre></div><p class="paragraph"/>Now if component <code>totalAmount</code> is not visible, its description (<code>Total amount:</code>) will be automatically hidden. If we have more then a Wicket component inside <code>&#60;wicket:enclosure&#62;</code> we can use <code>child</code> attribute to specify which component will control the overall visibility:<p class="paragraph"/><div class="code"><pre>&#60;wicket:enclosure child=<span class="java&#45;quote">"totalAmount"</span>&#62; 
@@ -318,7 +321,7 @@ Our data are rarely displayed alone with
 &#60;/wicket:enclosure&#62;</pre></div>
 
 
-<h2 id="chapter5_10">5.10 Surrounding existing markup with Border</h2>
+<h2 id="chapter5_10">6.10 Surrounding existing markup with Border</h2>
 Component <code>org.apache.wicket.markup.html.border.Border</code> is a special purpose container created to enclose its tag body with its related markup. Just like panels and pages, borders also have their own markup file which is defined following the same rules seen for panels and pages. In this file <code>&#60;wicket:border&#62;</code> tag is used to indicate which part of the content is to be considered as border markup:<p class="paragraph"/><div class="code"><pre>&#60;?xml version=<span class="java&#45;quote">"1.0"</span> encoding=<span class="java&#45;quote">"UTF&#45;8"</span>?&#62;
 &#60;html xmlns=<span class="java&#45;quote">"http://www.w3.org/1999/xhtml"</span> xmlns:wicket=<span class="java&#45;quote">"http://wicket.apache.org"</span>&#62;
 &#60;head&#62;&#60;/head&#62;
@@ -359,16 +362,16 @@ Component <code>org.apache.wicket.markup
 myBorder.add(<span class="java&#45;keyword">new</span> Label(<span class="java&#45;quote">"childTag"</span>, <span class="java&#45;quote">"Child inside tag."</span>));<p class="paragraph"/>add(myBorder);</pre></div>
 
 
-<h2 id="chapter5_11">5.11 Summary</h2>
+<h2 id="chapter5_11">6.11 Summary</h2>
 <p class="paragraph"/>In this chapter we have seen the tools provided by Wicket to gain complete control over the generated HTML. However we didn't see yet how we can repeat a portion of HTML with Wicket. With classic server-side technologies like PHP or JSP we use loops (like <code>while</code> or <code>for</code>) inside our pages to achieve this result. 
 To perform this task Wicket provides a special-purpose family of components called repeaters and designed to repeat their markup body to display a set of items.<p class="paragraph"/>But to fully understand how these components work, we must first learn more of Wicket's basics. That's why repeaters will be introduced later in <a href="../guide/single.html#chapter12" class="guide">chapter 12</a>.
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter4.html">&lt;&lt; <strong>4</strong><span>Wicket as page layout manager</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter4.html">&lt;&lt; <strong>5</strong><span>Wicket as page layout manager</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter6.html"><strong>6</strong><span>Components lifecycle</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter6.html"><strong>7</strong><span>Components lifecycle</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>

Modified: wicket/common/site/trunk/_site/guide/guide/chapter6.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter6.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter6.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter6.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>6 Components lifecycle 6.x</title>
+    <title>7 Components lifecycle 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/chapter5.html">&lt;&lt; <strong>5</strong><span>Keeping control over HTML</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter5.html">&lt;&lt; <strong>6</strong><span>Keeping control over HTML</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/chapter7.html"><strong>7</strong><span>Page versioning and caching</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter7.html"><strong>8</strong><span>Page versioning and caching</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>6 Components lifecycle - Reference Documentation</h1>
+                    <h1>7 Components lifecycle - 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="#chapter6_1"><strong>6.1</strong><span>Lifecycle stages of a component</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_1"><strong>7.1</strong><span>Lifecycle stages of a component</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_2"><strong>6.2</strong><span>Hook methods for component lifecycle</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_2"><strong>7.2</strong><span>Hook methods for component lifecycle</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_3"><strong>6.3</strong><span>Initialization stage</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_3"><strong>7.3</strong><span>Initialization stage</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_4"><strong>6.4</strong><span>Rendering stage</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_4"><strong>7.4</strong><span>Rendering stage</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_5"><strong>6.5</strong><span>Removing stage</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_5"><strong>7.5</strong><span>Removing stage</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_6"><strong>6.6</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter6_6"><strong>7.6</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -176,11 +179,11 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter6">6 Components lifecycle</h1>
+<h1 id="chapter6">7 Components lifecycle</h1>
 Just like applets and servlets, also Wicket components follow a lifecycle during their existence. In this chapter we will analyze each stage of this cycle and we will learn how to make the most of the hook methods that are triggered when a component moves from one stage to another.
 
 
-<h2 id="chapter6_1">6.1 Lifecycle stages of a component</h2>
+<h2 id="chapter6_1">7.1 Lifecycle stages of a component</h2>
 <p class="paragraph"/>During its life a Wicket component goes through three basic stages:
 <ol>
 <li><strong class="bold">Initialization:</strong> a component is instantiated by Wicket and prepared for the rendering phase.</li>
@@ -192,16 +195,16 @@ However this description introduces some
 </blockquote>
 
 
-<h2 id="chapter6_2">6.2 Hook methods for component lifecycle</h2>
+<h2 id="chapter6_2">7.2 Hook methods for component lifecycle</h2>
 <p class="paragraph"/>Class <code>Component</code> comes with a number of hook methods that can be overridden in order to customize component behavior during its lifecycle.
 In the following table these methods are grouped according to the stage in which they are invoked (and they are sorted by execution order):<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Cycle stage</strong></th><th><strong class="bold">Involved methods</strong></th></tr><tr class="table-odd"><td>Initialization</td><td>onInitialize</td></tr><tr class="table-even"><td>Rendering</td><td>onConfigure, onBeforeRender, onRender, onComponentTag, onComponentTagBody, onAfterRenderChildren, onAfterRender</td></tr><tr class="table-odd"><td>Removing</td><td>onRemove</td></tr></table><p class="paragraph"/>Now let's take a closer look at each stage and to at hook methods.
 
 
-<h2 id="chapter6_3">6.3 Initialization stage</h2>
+<h2 id="chapter6_3">7.3 Initialization stage</h2>
 <p class="paragraph"/>This stage is performed at the beginning of the component lifecycle. During initialization, the component has already been inserted into its component hierarchy so we can safely access to its parent container or to its page with methods <code>getParent()</code> or <code>getPage()</code>. The only method triggered during this stage is <code>onInitialize()</code>. This method is a sort of “special” constructor where we can execute a custom initialization of our component.<p class="paragraph"/>Since <code>onInitialize</code> is similar to a regular constructor, when we override this method we have to call <code>super.onInitialize</code> inside its body, usually as first instruction.
 
 
-<h2 id="chapter6_4">6.4 Rendering stage</h2>
+<h2 id="chapter6_4">7.4 Rendering stage</h2>
 This stage is triggered each time a component is rendered by Wicket, typically when its page is requested or when it is refreshed via AJAX.<p class="paragraph"/><h3>Method onConfigure</h3><p class="paragraph"/>Method <code>onConfigure()</code> has been introduced in order to provide a good point to manage the component states such as its visibility or enabled state. This method is called before the render phase starts. As stated in <a href="../guide/single.html#chapter5_1" class="guide">chapter 5.1</a>, <code>isVisible</code> and <code>isEnabled</code> are called multiple times when a page or a component is rendered, so it's highly recommended not to directly override these method, but rather to use <code>onConfigure</code> to change component states. On the contrary method <code>onBeforeRender</code> (see the next paragraph) is not indicated for this task because it will not be invoked if component visibility is set to false.<p class="paragraph"/><h3>Method onBeforeRender</h3><p cl
 ass="paragraph"/>The most important hook method of this stage is probably <code>onBeforeRender()</code>. This method is called before a component starts its rendering phase and it is our last chance to change its children hierarchy.<p class="paragraph"/>If we want add/remove children components this is the right place to do it. In the next example (project LifeCycleStages) we will create a page which alternately displays two different labels, swapping between them each time it is rendered:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class HomePage <span class="java&#45;keyword">extends</span> WebPage
 &#123;
 	<span class="java&#45;keyword">private</span> Label firstLabel;
@@ -259,20 +262,20 @@ If we forget to call superclass version 
 &#125;</pre></div><p class="paragraph"/>Note that the original version of <code>onComponentTagBody</code> is invoked only when we want to preserve the standard rendering mechanism for the tag's body (in our example this happens when the component is enabled).
 
 
-<h2 id="chapter6_5">6.5 Removing stage</h2>
+<h2 id="chapter6_5">7.5 Removing stage</h2>
 <p class="paragraph"/>This stage is triggered when a component is removed from its component hierarchy. The only hook method for this phase is <code>onRemove()</code>. If our component still holds some resources needed during rendering phase, we can override this method to release them.<p class="paragraph"/>Once a component has been removed we are free to add it again to the same container or to a different one.
 
 
-<h2 id="chapter6_6">6.6 Summary</h2>
+<h2 id="chapter6_6">7.6 Summary</h2>
 <p class="paragraph"/>In this chapter we have seen which stages compose the lifecycle of Wicket components and which hook methods they provide. Overriding these methods we can dynamically modify the component hierarchy and we can enrich the behavior of our custom components.
 
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter5.html">&lt;&lt; <strong>5</strong><span>Keeping control over HTML</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter5.html">&lt;&lt; <strong>6</strong><span>Keeping control over HTML</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter7.html"><strong>7</strong><span>Page versioning and caching</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter7.html"><strong>8</strong><span>Page versioning and caching</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>

Modified: wicket/common/site/trunk/_site/guide/guide/chapter7.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/chapter7.html?rev=1540864&r1=1540863&r2=1540864&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/chapter7.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/chapter7.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>7 Page versioning and caching 6.x</title>
+    <title>8 Page versioning and caching 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/chapter6.html">&lt;&lt; <strong>6</strong><span>Components lifecycle</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter6.html">&lt;&lt; <strong>7</strong><span>Components lifecycle</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/chapter8.html"><strong>8</strong><span>Under the hood of the request processing</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter8.html"><strong>9</strong><span>Under the hood of the request processing</span> >></a></div>
                 
 
 
                 <div class="project">
-                    <h1>7 Page versioning and caching - Reference Documentation</h1>
+                    <h1>8 Page versioning and caching - 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="#chapter7_1"><strong>7.1</strong><span>Stateful pages vs stateless</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_1"><strong>8.1</strong><span>Stateful pages vs stateless</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_2"><strong>7.2</strong><span>Stateful pages</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_2"><strong>8.2</strong><span>Stateful pages</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_3"><strong>7.3</strong><span>Stateless pages</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_3"><strong>8.3</strong><span>Stateless pages</span></a>
                     </div>
                     
-                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_4"><strong>7.4</strong><span>Summary</span></a>
+                    <div class="toc-item" style="margin-left:0px"><a href="#chapter7_4"><strong>8.4</strong><span>Summary</span></a>
                     </div>
                     
                 </div>
@@ -170,17 +173,17 @@ function addJsClass() {
 
                 
 
-<h1 id="chapter7">7 Page versioning and caching</h1>
+<h1 id="chapter7">8 Page versioning and caching</h1>
 This chapter explains how Wicket manages page instances, underlining the difference between stateful and stateless pages. The chapter also introduces some advanced topics like Java Serialization and multi-level cache. However, to understand what you will read you are not required to be familiar with these concepts.
 
 
-<h2 id="chapter7_1">7.1 Stateful pages vs stateless</h2>
+<h2 id="chapter7_1">8.1 Stateful pages vs stateless</h2>
 <p class="paragraph"/>Wicket pages can be divided into two categories: stateful and stateless pages. Stateful pages are those which rely on user session to store they internal state and to keep track of user interaction.
 On the contrary stateless pages are those which don't change their internal state during their lifecycle and they don't need to occupy space into user session.<p class="paragraph"/>From Wicket's point of view the biggest difference between these two types of page is that stateful pages are versioned, meaning that they will be saved into user session every time their internal state has changed. Wicket automatically assigns a session to the user the first time a stateful page is requested. Page versions are stored into user session using Java Serialization mechanism. 
 Stateless pages are never versioned and that's why they don't require a valid user session. If we want to know whether a page is stateless or not, we can call the isPageStateless() method of class Page.<p class="paragraph"/>In order to build a stateless page we must comply with some rules to ensure that the page won't need to use user session. These rules are illustrated in paragraph 6.3 but before talking about stateless pages we must first understand how stateful pages are handled and why they are versioned.
 
 
-<h2 id="chapter7_2">7.2 Stateful pages</h2>
+<h2 id="chapter7_2">8.2 Stateful pages</h2>
 <p class="paragraph"/>Stateful pages are versioned in order to support browser's back button: when this button is pressed Wicket must respond by rendering the same page instance previously used.<p class="paragraph"/>A new page version is created when a stateful page is requested for the first time or when an existing instance is modified (for example changing its component hierarchy). To identify each page version Wicket uses a session-relative identifier called page id. This is a unique number and it is increased every time a new page version is created.<p class="paragraph"/>In the final example of the previous chapter (project LifeCycleStages), you may have noticed the number appended at the and of URL. This number is the page id we are talking about:<p class="paragraph"/><img border="0" class="center" src="../img/page-id.png"></img><p class="paragraph"/>In this chapter we will use a revised version of this example project where the component hierarchy is modified inside the Link'
 s onClick()method. This is necessary because Wicket creates a new page version only if the page is modified before its method onBeforeRender() is invoked. The code of the new home page is the following:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">public</span> class HomePage <span class="java&#45;keyword">extends</span> WebPage
 &#123;
 	<span class="java&#45;keyword">private</span> <span class="java&#45;keyword">static</span> <span class="java&#45;keyword">final</span> <span class="java&#45;object">long</span> serialVersionUID = 1L;
@@ -228,7 +231,7 @@ For the second level cache we can use th
 
 
 
-<h2 id="chapter7_3">7.3 Stateless pages</h2>
+<h2 id="chapter7_3">8.3 Stateless pages</h2>
 <p class="paragraph"/>Wicket makes it very easy to build stateful pages, but sometimes we might want to use an “old school” stateless page that doesn't keep memory of its state in the user session. For example consider the public area of a site or a login page: in those cases a stateful page would be a waste of resources or even a security threat, as we will see in paragraph 10.9.<p class="paragraph"/>In Wicket a page can be stateless only if it satisfies the following requirements:
 <ol>
 <li>it has been instantiated by Wicket (i.e. we don't create it with operator new) using a constructor with no argument or a constructor that takes as input a single PageParameters argument (class PageParameters will be covered in chapter 8).</li>
@@ -255,15 +258,15 @@ Page '&#60;page class&#62;' is not state
 
 
 
-<h2 id="chapter7_4">7.4 Summary</h2>
+<h2 id="chapter7_4">8.4 Summary</h2>
 <p class="paragraph"/>In this chapter we have seen how page instances are managed by Wicket. We have learnt that pages can be divided into two families: stateless and stateful pages. Knowing the difference between the two types of pages is important to build the right page for a given task.<p class="paragraph"/>However, to complete the discussion about stateless pages we still have to deal with two topics we have just outlined in this chapter: class PageParameters and bookmarkable pages. The first part of chapter 8 will cover these missing topics.
 
 
                 <div style="clear:both;margin-top:15px;"></div>
                 
-                    <div class="toc-item prev-left"><a href="../guide/chapter6.html">&lt;&lt; <strong>6</strong><span>Components lifecycle</span></a></div>
+                    <div class="toc-item prev-left"><a href="../guide/chapter6.html">&lt;&lt; <strong>7</strong><span>Components lifecycle</span></a></div>
                 
-                    <div class="toc-item next-right"><a href="../guide/chapter8.html"><strong>8</strong><span>Under the hood of the request processing</span> >></a></div>
+                    <div class="toc-item next-right"><a href="../guide/chapter8.html"><strong>9</strong><span>Under the hood of the request processing</span> >></a></div>
                 
                 <div style="clear:both"></div>
             </div>