http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/learn/examples/markupinheritance.html ---------------------------------------------------------------------- diff --git a/content/learn/examples/markupinheritance.html b/content/learn/examples/markupinheritance.html index fb8e421..cb5ffeb 100644 --- a/content/learn/examples/markupinheritance.html +++ b/content/learn/examples/markupinheritance.html @@ -19,19 +19,19 @@ <div class="l-container"> <nav class="mainmenu"> <ul> - <!-- /start/quickstart.html || /learn/examples/markupinheritance.html --> + <!-- /start/quickstart.html || /learn/examples/markupinheritance --> <li class=""><a href="/start/quickstart.html">Quick Start</a></li> - <!-- /start/download.html || /learn/examples/markupinheritance.html --> + <!-- /start/download.html || /learn/examples/markupinheritance --> <li class=""><a href="/start/download.html">Download</a></li> - <!-- /learn || /learn/examples/markupinheritance.html --> + <!-- /learn || /learn/examples/markupinheritance --> <li class=""><a href="/learn">Documentation</a></li> - <!-- /help || /learn/examples/markupinheritance.html --> + <!-- /help || /learn/examples/markupinheritance --> <li class=""><a href="/help">Support</a></li> - <!-- /contribute || /learn/examples/markupinheritance.html --> + <!-- /contribute || /learn/examples/markupinheritance --> <li class=""><a href="/contribute">Contribute</a></li> - <!-- /community || /learn/examples/markupinheritance.html --> + <!-- /community || /learn/examples/markupinheritance --> <li class=""><a href="/community">Community</a></li> - <!-- /apache || /learn/examples/markupinheritance.html --> + <!-- /apache || /learn/examples/markupinheritance --> <li class=""><a href="/apache">Apache</a></li> </ul> </nav> @@ -75,19 +75,19 @@ and panels) can inherit the markup of their super containers.</p> <code><wicket:extend></code>. In the super markup you define where the child markup should be put, and in the sub markup you delineate where the child markup starts and ends.</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> This is in the super markup.<span class="nt"><br></span> <span class="nt"><wicket:child</span> <span class="nt">/></span> This is in the super markup.<span class="nt"><br></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>In this markup you see two sentences that surround the <code><wicket:child></code> tag. All markup in this file will remain when a sub class of this page is created, only the <code><wicket:child></code> tag will be replaced with the child markup. So if we look at the following markup:</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> This is in de child markup.<span class="nt"><br></span> @@ -96,12 +96,12 @@ look at the following markup:</p> <span class="nt"></wicket:extend></span> This is in the child markup.<span class="nt"><br></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>we can see the markup that should be included in the parent. Only the markup between the <code><wicket:extend></code> tags is included in the final page. Take a look at the following markup which is the final markup when you would use this in a Wicket application.</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> This is in the super markup.<span class="nt"><br></span> @@ -110,7 +110,7 @@ a Wicket application.</p> <span class="nt"></wicket:extend></wicket:child></span> This is in the super markup.<span class="nt"><br></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>Here you can see that the <code><wicket:child /></code> tag has been expanded, and its contents filled with exactly the markup between the <code><wicket:extend></code> tags. If you want to get rid of the special Wicket tags, you can disable that on @@ -120,35 +120,35 @@ or <a href="https://ci.apache.org/projects/wicket/apidocs/7.x/org/apache/wicket/ <h2 id="implementing-the-basepage">Implementing the BasePage</h2> <p>Now that we have seen the basics for markup inheritance, we can take a look at the example at hand. Letâs first create the base page.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.WebPage</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.basic.Label</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.link.BookmarkablePageLink</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">abstract</span> <span class="kd">class</span> <span class="nc">BasePage</span> <span class="kd">extends</span> <span class="n">WebPage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">BasePage</span><span class="o">()</span> <span class="o">{</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">BookmarkablePageLink</span><span class="o">(</span><span class="s">"page1"</span><span class="o">,</span> <span class="n">Page1</span><span class="o">.</span><span class="na">class</span><span class="o">));</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">BookmarkablePageLink</span><span class="o">(</span><span class="s">"page2"</span><span class="o">,</span> <span class="n">Page2</span><span class="o">.</span><span class="na">class</span><span class="o">));</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Label</span><span class="o">(</span><span class="s">"footer"</span><span class="o">,</span> <span class="s">"This is in the footer"</span><span class="o">));</span> + <span class="kd">public</span> <span class="n">BasePage</span><span class="o">()</span> <span class="o">{</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">BookmarkablePageLink</span><span class="o">(</span><span class="s">"page1"</span><span class="o">,</span> <span class="n">Page1</span><span class="o">.</span><span class="na">class</span><span class="o">));</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">BookmarkablePageLink</span><span class="o">(</span><span class="s">"page2"</span><span class="o">,</span> <span class="n">Page2</span><span class="o">.</span><span class="na">class</span><span class="o">));</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Label</span><span class="o">(</span><span class="s">"footer"</span><span class="o">,</span> <span class="s">"This is in the footer"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <p>The two links should go into the header, and the footer in the footer of the page. Note that the abstract keyword isnât required, but considered a good practise. Now letâs take a look at the markup for the BasePage</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> -<span class="nt"><div</span> <span class="na">id=</span><span class="s">"header"</span><span class="nt">></span> - <span class="nt"><a</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">wicket:id=</span><span class="s">"page1"</span><span class="nt">></span>Page1<span class="nt"></a></span> - <span class="nt"><a</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">wicket:id=</span><span class="s">"page2"</span><span class="nt">></span>Page2<span class="nt"></a></span> +<span class="nt"><div</span> <span class="na">id=</span><span class="s">"header"</span><span class="nt">></span> + <span class="nt"><a</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">wicket:id=</span><span class="s">"page1"</span><span class="nt">></span>Page1<span class="nt"></a></span> + <span class="nt"><a</span> <span class="na">href=</span><span class="s">"#"</span> <span class="na">wicket:id=</span><span class="s">"page2"</span><span class="nt">></span>Page2<span class="nt"></a></span> <span class="nt"></div></span> -<span class="nt"><div</span> <span class="na">id=</span><span class="s">"body"</span><span class="nt">></span> +<span class="nt"><div</span> <span class="na">id=</span><span class="s">"body"</span><span class="nt">></span> <span class="nt"><wicket:child</span> <span class="nt">/></span> <span class="nt"></div></span> -<span class="nt"><div</span> <span class="na">id=</span><span class="s">"footer"</span><span class="nt">></span> - <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"footer"</span><span class="nt">></span></span> +<span class="nt"><div</span> <span class="na">id=</span><span class="s">"footer"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"footer"</span><span class="nt">></span></span> <span class="nt"></div></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>In this markup file you see the specific basic layout: we have 3 div elements:</p> <ol> @@ -163,46 +163,46 @@ to finish this example.</p> <h2 id="implementing-the-sub-pages">Implementing the sub pages</h2> <p>We need to build two pages: <code>Page1</code> and <code>Page2</code>. Each page needs its own markup file and Java class. Letâs first implement <code>Page1</code>.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.basic.Label</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Page1</span> <span class="kd">extends</span> <span class="n">BasePage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Page1</span><span class="o">()</span> <span class="o">{</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Label</span><span class="o">(</span><span class="s">"label1"</span><span class="o">,</span> <span class="s">"This is in the subclass Page1"</span><span class="o">));</span> + <span class="kd">public</span> <span class="n">Page1</span><span class="o">()</span> <span class="o">{</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Label</span><span class="o">(</span><span class="s">"label1"</span><span class="o">,</span> <span class="s">"This is in the subclass Page1"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <p>In this example you see that we add a new label component to the page: <code>label1</code>. This component is only available for <code>Page1</code>, as such <code>Page2</code> can define its own component hierarchy. Letâs take a look at the markup for <code>Page1</code>:</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="o"><</span><span class="n">html</span><span class="o">></span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="o"><</span><span class="n">html</span><span class="o">></span> <span class="o"><</span><span class="n">head</span><span class="o">></</span><span class="n">head</span><span class="o">></span> <span class="o"><</span><span class="n">body</span><span class="o">></span> <span class="o"><</span><span class="nl">wicket:</span><span class="n">extend</span><span class="o">></span> <span class="o"><</span><span class="n">h1</span><span class="o">></span><span class="n">Page1</span><span class="o"></</span><span class="n">h1</span><span class="o">></span> - <span class="o"><</span><span class="n">span</span> <span class="nl">wicket:</span><span class="n">id</span><span class="o">=</span><span class="s">"label1"</span><span class="o">></</span><span class="n">span</span><span class="o">></span> + <span class="o"><</span><span class="n">span</span> <span class="nl">wicket:</span><span class="n">id</span><span class="o">=</span><span class="s">"label1"</span><span class="o">></</span><span class="n">span</span><span class="o">></span> <span class="o"></</span><span class="nl">wicket:</span><span class="n">extend</span><span class="o">></span> <span class="o"></</span><span class="n">body</span><span class="o">></span> -<span class="o"></</span><span class="n">html</span><span class="o">></span></code></pre></div> +<span class="o"></</span><span class="n">html</span><span class="o">></span></code></pre></figure> <p>Here you see that we added the <code>Label</code> component in the markup between the <code><wicket:extend></code> tags. If we were to add the component outside those tags, Wicket will not be able to render the component in the final page.</p> <p>Now, letâs do the same for <code>Page2</code>.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.basic.Label</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Page2</span> <span class="kd">extends</span> <span class="n">BasePage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Page2</span><span class="o">()</span> <span class="o">{</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Label</span><span class="o">(</span><span class="s">"label2"</span><span class="o">,</span> <span class="s">"This is in the subclass Page2"</span><span class="o">));</span> + <span class="kd">public</span> <span class="n">Page2</span><span class="o">()</span> <span class="o">{</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Label</span><span class="o">(</span><span class="s">"label2"</span><span class="o">,</span> <span class="s">"This is in the subclass Page2"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<span class="o">}</span></code></pre></figure> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> <span class="nt"><wicket:extend></span> <span class="nt"><h1></span>Page2<span class="nt"></h1></span> - <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"label2"</span><span class="nt">></span></span> + <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"label2"</span><span class="nt">></span></span> <span class="nt"></wicket:extend></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>In <code>Page2</code> you see that we have a different component structure (<code>label2</code> instead of <code>label1</code>), and as such that the pages are quite different.</p> <p>If you paste this code into a Wicket quickstart application, you can see it
http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/learn/examples/navomatic.html ---------------------------------------------------------------------- diff --git a/content/learn/examples/navomatic.html b/content/learn/examples/navomatic.html index 467d744..e228c1f 100644 --- a/content/learn/examples/navomatic.html +++ b/content/learn/examples/navomatic.html @@ -19,19 +19,19 @@ <div class="l-container"> <nav class="mainmenu"> <ul> - <!-- /start/quickstart.html || /learn/examples/navomatic.html --> + <!-- /start/quickstart.html || /learn/examples/navomatic --> <li class=""><a href="/start/quickstart.html">Quick Start</a></li> - <!-- /start/download.html || /learn/examples/navomatic.html --> + <!-- /start/download.html || /learn/examples/navomatic --> <li class=""><a href="/start/download.html">Download</a></li> - <!-- /learn || /learn/examples/navomatic.html --> + <!-- /learn || /learn/examples/navomatic --> <li class=""><a href="/learn">Documentation</a></li> - <!-- /help || /learn/examples/navomatic.html --> + <!-- /help || /learn/examples/navomatic --> <li class=""><a href="/help">Support</a></li> - <!-- /contribute || /learn/examples/navomatic.html --> + <!-- /contribute || /learn/examples/navomatic --> <li class=""><a href="/contribute">Contribute</a></li> - <!-- /community || /learn/examples/navomatic.html --> + <!-- /community || /learn/examples/navomatic --> <li class=""><a href="/community">Community</a></li> - <!-- /apache || /learn/examples/navomatic.html --> + <!-- /apache || /learn/examples/navomatic --> <li class=""><a href="/apache">Apache</a></li> </ul> </nav> @@ -81,27 +81,27 @@ first <code><wicket:body/></code> tag in the borderâs associated markup. <p>For example, here is markup for a simple Border subclass, a usage of that border, and the markup which would be output on rendering:</p> <h3 id="border-markup">Border markup</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> <span class="nt"><wicket:border></span> First <span class="nt"><wicket:body/></span> Last <span class="nt"></wicket:border></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <h3 id="border-usage">Border usage</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> - <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"myBorder"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"myBorder"</span><span class="nt">></span> Middle <span class="nt"></span></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <h3 id="rendered-markup">Rendered markup</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> First Middle Last <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>In other words, the markup around the <code><wicket:body/></code> tag in the border component is sort of âwrapped aroundâ the body of the <code><span></code> tag where the border is used. This seems simple in this example, but keep in mind that @@ -111,32 +111,32 @@ code.</p> <h3 id="navomaticapplicationjava">NavomaticApplication.java</h3> <p>Just as in the Hello World! example, we need to define our application. In this case, we set Page1 to be our home page.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">org.apache.wicket.protocol.http.WebApplication</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">NavomaticApplication</span> <span class="kd">extends</span> <span class="n">WebApplication</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">NavomaticApplication</span><span class="o">()</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">NavomaticApplication</span><span class="o">()</span> <span class="o">{</span> <span class="o">}</span> - <span class="kd">public</span> <span class="n">Class</span> <span class="nf">getHomePage</span><span class="o">()</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">Class</span> <span class="n">getHomePage</span><span class="o">()</span> <span class="o">{</span> <span class="k">return</span> <span class="n">Page1</span><span class="o">.</span><span class="na">class</span><span class="o">;</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <h3 id="page1java">Page1.java</h3> <p>The Page1 Java and HTML files look like this:</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">org.apache.wicket.markup.html.WebPage</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Page1</span> <span class="kd">extends</span> <span class="n">WebPage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Page1</span><span class="o">()</span> <span class="o">{</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">NavomaticBorder</span><span class="o">(</span><span class="s">"navomaticBorder"</span><span class="o">));</span> + <span class="kd">public</span> <span class="n">Page1</span><span class="o">()</span> <span class="o">{</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">NavomaticBorder</span><span class="o">(</span><span class="s">"navomaticBorder"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <h3 id="page1html">Page1.html</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> - <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navomaticBorder"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navomaticBorder"</span><span class="nt">></span> You are viewing Page1 <span class="nt"></span></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>Notice that the NavomaticBorder component is attached to the <code><span></code> tag because the name of the component in the Java code is ânavomaticBorderâ and the <code><span></code> tagâs wicket:id attribute is set to ânavomaticBorderâ. Because the @@ -145,55 +145,55 @@ two names match, Wicket associates the NavomaticBorder Java component with the <h3 id="page2java">Page2.java</h3> <p>The Page2 Java and HTML files look almost identical (and weâll omit the sources for Page3 altogether because it follows the same pattern):</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Page2</span> <span class="kd">extends</span> <span class="n">WebPage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Page2</span><span class="o">()</span> <span class="o">{</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">NavomaticBorder</span><span class="o">(</span><span class="s">"navomaticBorder"</span><span class="o">));</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Page2</span> <span class="kd">extends</span> <span class="n">WebPage</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">Page2</span><span class="o">()</span> <span class="o">{</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">NavomaticBorder</span><span class="o">(</span><span class="s">"navomaticBorder"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <h3 id="page2html">Page2.html</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> - <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navomaticBorder"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navomaticBorder"</span><span class="nt">></span> You are viewing Page2 <span class="nt"></span></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <h3 id="navomaticborderjava">NavomaticBorder.java</h3> <p>So how does NavomaticBorder work? Glad you asked. The Java code below simply adds the two BoxBorder components you see. These components are nested borders which each draw a thin black line around their contents. The rest of the magic is in the NavomaticBorder markup.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">examples</span><span class="o">.</span><span class="na">navomatic</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">org.apache.wicket.markup.html.border.Border</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">org.apache.wicket.markup.html.border.BoxBorder</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">NavomaticBorder</span> <span class="kd">extends</span> <span class="n">Border</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">NavomaticBorder</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">componentName</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">NavomaticBorder</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">componentName</span><span class="o">)</span> <span class="o">{</span> <span class="kd">super</span><span class="o">(</span><span class="n">componentName</span><span class="o">);</span> - <span class="n">addToBorder</span><span class="o">(</span><span class="k">new</span> <span class="nf">BoxBorder</span><span class="o">(</span><span class="s">"navigationBorder"</span><span class="o">));</span> - <span class="n">addToBorder</span><span class="o">(</span><span class="k">new</span> <span class="nf">BoxBorder</span><span class="o">(</span><span class="s">"bodyBorder"</span><span class="o">));</span> + <span class="n">addToBorder</span><span class="o">(</span><span class="k">new</span> <span class="n">BoxBorder</span><span class="o">(</span><span class="s">"navigationBorder"</span><span class="o">));</span> + <span class="n">addToBorder</span><span class="o">(</span><span class="k">new</span> <span class="n">BoxBorder</span><span class="o">(</span><span class="s">"bodyBorder"</span><span class="o">));</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <h3 id="navomaticborderhtml">NavomaticBorder.html</h3> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><body></span> <span class="nt"><wicket:border></span> <span class="nt"><p></span> <span class="nt"><table></span> <span class="nt"><tr></span> <span class="nt"><td></span> - <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navigationBorder"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"navigationBorder"</span><span class="nt">></span> <span class="nt"><b></span>Navigation Links<span class="nt"></b></span> <span class="nt"><p></span> <span class="nt"><wicket:link></span> - <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page1.html"</span><span class="nt">></span>Page1<span class="nt"></a><br/></span> - <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page2.html"</span><span class="nt">></span>Page2<span class="nt"></a><br/></span> - <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page3.html"</span><span class="nt">></span>Page3<span class="nt"></a></span> + <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page1.html"</span><span class="nt">></span>Page1<span class="nt"></a><br/></span> + <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page2.html"</span><span class="nt">></span>Page2<span class="nt"></a><br/></span> + <span class="nt"><a</span> <span class="na">href =</span><span class="err"> </span><span class="s">"Page3.html"</span><span class="nt">></span>Page3<span class="nt"></a></span> <span class="nt"></wicket:link></span> <span class="nt"></p></span> <span class="nt"></span></span> <span class="nt"></td></span> <span class="nt"><td></span> - <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"bodyBorder"</span><span class="nt">></span> + <span class="nt"><span</span> <span class="na">wicket:id =</span><span class="err"> </span><span class="s">"bodyBorder"</span><span class="nt">></span> <span class="nt"><wicket:body/></span> <span class="nt"></span></span> <span class="nt"></td></span> @@ -202,7 +202,7 @@ is in the NavomaticBorder markup.</p> <span class="nt"></p></span> <span class="nt"></wicket:border></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>Notice that the markup above encloses the entire contents of the markup fileâs <code><body></code> with a <code><wicket:border></code> tag, as we described earlier. This lets the NavomaticBorder know how much of its markup to use when it wraps itself around @@ -225,7 +225,7 @@ current page (since the link would be useless) and italicizes the link text.</p> <p>In order to get this application up and running, we need to register the application with the Wicket servlet in the web.xml file. The following sections need to be added to the web.xml in the WEB-INF folder.</p> -<div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><servlet></span> +<figure class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><servlet></span> <span class="nt"><servlet-name></span>NavomaticApplication<span class="nt"></servlet-name></span> <span class="nt"><servlet-class></span>org.apache.wicket.protocol.http.WicketServlet<span class="nt"></servlet-class></span> <span class="nt"><init-param></span> @@ -237,7 +237,7 @@ sections need to be added to the web.xml in the WEB-INF folder.</p> <span class="nt"><servlet-mapping></span> <span class="nt"><servlet-name></span>NavomaticApplication<span class="nt"></servlet-name></span> <span class="nt"><url-pattern></span>/app/*<span class="nt"></url-pattern></span> -<span class="nt"></servlet-mapping></span></code></pre></div> +<span class="nt"></servlet-mapping></span></code></pre></figure> </section> </div> </main> http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/learn/examples/usingfragments.html ---------------------------------------------------------------------- diff --git a/content/learn/examples/usingfragments.html b/content/learn/examples/usingfragments.html index 04f29f2..34c037b 100644 --- a/content/learn/examples/usingfragments.html +++ b/content/learn/examples/usingfragments.html @@ -19,19 +19,19 @@ <div class="l-container"> <nav class="mainmenu"> <ul> - <!-- /start/quickstart.html || /learn/examples/usingfragments.html --> + <!-- /start/quickstart.html || /learn/examples/usingfragments --> <li class=""><a href="/start/quickstart.html">Quick Start</a></li> - <!-- /start/download.html || /learn/examples/usingfragments.html --> + <!-- /start/download.html || /learn/examples/usingfragments --> <li class=""><a href="/start/download.html">Download</a></li> - <!-- /learn || /learn/examples/usingfragments.html --> + <!-- /learn || /learn/examples/usingfragments --> <li class=""><a href="/learn">Documentation</a></li> - <!-- /help || /learn/examples/usingfragments.html --> + <!-- /help || /learn/examples/usingfragments --> <li class=""><a href="/help">Support</a></li> - <!-- /contribute || /learn/examples/usingfragments.html --> + <!-- /contribute || /learn/examples/usingfragments --> <li class=""><a href="/contribute">Contribute</a></li> - <!-- /community || /learn/examples/usingfragments.html --> + <!-- /community || /learn/examples/usingfragments --> <li class=""><a href="/community">Community</a></li> - <!-- /apache || /learn/examples/usingfragments.html --> + <!-- /apache || /learn/examples/usingfragments --> <li class=""><a href="/apache">Apache</a></li> </ul> </nav> @@ -67,35 +67,35 @@ example</a>.</p> <p>First things first, letâs create a page that we can add our fragments to. We will add a Loop that will repeat markup and choose a different Fragment for each item in the loop.</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> <span class="nt"><ul></span> - <span class="nt"><li</span> <span class="na">wicket:id=</span><span class="s">"list"</span><span class="nt">><span</span> <span class="na">wicket:id=</span><span class="s">"panel"</span><span class="nt">></span></li></span> + <span class="nt"><li</span> <span class="na">wicket:id=</span><span class="s">"list"</span><span class="nt">><span</span> <span class="na">wicket:id=</span><span class="s">"panel"</span><span class="nt">></span></li></span> <span class="nt"></ul></span> - <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment1"</span><span class="nt">></span>panel 1<span class="nt"></wicket:fragment></span> - <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment2"</span><span class="nt">></span>panel 2<span class="nt"></wicket:fragment></span> + <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment1"</span><span class="nt">></span>panel 1<span class="nt"></wicket:fragment></span> + <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment2"</span><span class="nt">></span>panel 2<span class="nt"></wicket:fragment></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>As you can see in this markup file, we already took care of adding the fragment markup to the page in the <code><wicket:fragment></code> tags. Each fragment can contain its own markup and components. Those components need to be added to the Fragment instance in the Java file, just as you would do with a panel and web markup container.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.list.Loop</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.panel.Fragment</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">extends</span> <span class="n">QuickStartPage</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Index</span><span class="o">()</span> <span class="o">{</span> - <span class="n">Loop</span> <span class="n">loop</span> <span class="o">=</span> <span class="k">new</span> <span class="nf">Loop</span><span class="o">(</span><span class="s">"list"</span><span class="o">,</span> <span class="mi">5</span><span class="o">)</span> <span class="o">{</span> - <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">populateItem</span><span class="o">(</span><span class="n">LoopItem</span> <span class="n">item</span><span class="o">)</span> <span class="o">{</span> - <span class="n">String</span> <span class="n">fragmentId</span> <span class="o">=</span> <span class="s">"fragment"</span> <span class="o">+</span> <span class="o">(</span><span class="n">item</span><span class="o">.</span><span class="na">getIteration</span><span class="o">()</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="o">);</span> - <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Fragment</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">,</span> <span class="n">Index</span><span class="o">.</span><span class="na">this</span><span class="o">));</span> + <span class="kd">public</span> <span class="n">Index</span><span class="o">()</span> <span class="o">{</span> + <span class="n">Loop</span> <span class="n">loop</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Loop</span><span class="o">(</span><span class="s">"list"</span><span class="o">,</span> <span class="mi">5</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">protected</span> <span class="kt">void</span> <span class="n">populateItem</span><span class="o">(</span><span class="n">LoopItem</span> <span class="n">item</span><span class="o">)</span> <span class="o">{</span> + <span class="n">String</span> <span class="n">fragmentId</span> <span class="o">=</span> <span class="s">"fragment"</span> <span class="o">+</span> <span class="o">(</span><span class="n">item</span><span class="o">.</span><span class="na">getIteration</span><span class="o">()</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="o">);</span> + <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Fragment</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">,</span> <span class="n">Index</span><span class="o">.</span><span class="na">this</span><span class="o">));</span> <span class="o">}</span> <span class="o">};</span> <span class="n">add</span><span class="o">(</span><span class="n">loop</span><span class="o">);</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <p>The Loop will render 5 items, and the <code>populateItem</code> method will be called for each item. In each item we construct a fragment identifier that corresponds to the identifier in the <code><wicket:fragment></code>. The <code>Fragment</code> @@ -105,44 +105,44 @@ fragment identifier telling it where to find the specific markup in the file.</p <p>In the previous example we just showed different markup for each fragment, but you can add components to the fragments as well. Letâs add a label to fragment 1.</p> -<div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> +<figure class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt"><html></span> <span class="nt"><head></head></span> <span class="nt"><body></span> <span class="nt"><ul></span> - <span class="nt"><li</span> <span class="na">wicket:id=</span><span class="s">"list"</span><span class="nt">><span</span> <span class="na">wicket:id=</span><span class="s">"panel"</span><span class="nt">></span></li></span> + <span class="nt"><li</span> <span class="na">wicket:id=</span><span class="s">"list"</span><span class="nt">><span</span> <span class="na">wicket:id=</span><span class="s">"panel"</span><span class="nt">></span></li></span> <span class="nt"></ul></span> - <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment1"</span><span class="nt">></span>panel 1 <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"label"</span><span class="nt">></span></wicket:fragment></span> - <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment2"</span><span class="nt">></span>panel 2<span class="nt"></wicket:fragment></span> + <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment1"</span><span class="nt">></span>panel 1 <span class="nt"><span</span> <span class="na">wicket:id=</span><span class="s">"label"</span><span class="nt">></span></wicket:fragment></span> + <span class="nt"><wicket:fragment</span> <span class="na">wicket:id=</span><span class="s">"fragment2"</span><span class="nt">></span>panel 2<span class="nt"></wicket:fragment></span> <span class="nt"></body></span> -<span class="nt"></html></span></code></pre></div> +<span class="nt"></html></span></code></pre></figure> <p>In order to add the component to the first fragment weâll introduce a subclass for fragment one to encapsulate the component.</p> -<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">package</span> <span class="n">wicket</span><span class="o">.</span><span class="na">quickstart</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.basic.Label</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.list.Loop</span><span class="o">;</span> <span class="kn">import</span> <span class="nn">wicket.markup.html.panel.Fragment</span><span class="o">;</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Index</span> <span class="kd">extends</span> <span class="n">QuickStartPage</span> <span class="o">{</span> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">Fragment1</span> <span class="kd">extends</span> <span class="n">Fragment</span> <span class="o">{</span> - <span class="kd">public</span> <span class="nf">Fragment1</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">,</span> <span class="n">String</span> <span class="n">markupId</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">Fragment1</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">,</span> <span class="n">String</span> <span class="n">markupId</span><span class="o">)</span> <span class="o">{</span> <span class="kd">super</span><span class="o">(</span><span class="n">id</span><span class="o">,</span> <span class="n">markupId</span><span class="o">,</span> <span class="n">Index</span><span class="o">.</span><span class="na">this</span><span class="o">);</span> - <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Label</span><span class="o">(</span><span class="s">"label"</span><span class="o">,</span> <span class="s">"Hello, World!"</span><span class="o">));</span> + <span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Label</span><span class="o">(</span><span class="s">"label"</span><span class="o">,</span> <span class="s">"Hello, World!"</span><span class="o">));</span> <span class="o">}</span> <span class="o">}</span> - <span class="kd">public</span> <span class="nf">Index</span><span class="o">()</span> <span class="o">{</span> - <span class="n">Loop</span> <span class="n">loop</span> <span class="o">=</span> <span class="k">new</span> <span class="nf">Loop</span><span class="o">(</span><span class="s">"list"</span><span class="o">,</span> <span class="mi">5</span><span class="o">)</span> <span class="o">{</span> - <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">populateItem</span><span class="o">(</span><span class="n">LoopItem</span> <span class="n">item</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">public</span> <span class="n">Index</span><span class="o">()</span> <span class="o">{</span> + <span class="n">Loop</span> <span class="n">loop</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Loop</span><span class="o">(</span><span class="s">"list"</span><span class="o">,</span> <span class="mi">5</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">protected</span> <span class="kt">void</span> <span class="n">populateItem</span><span class="o">(</span><span class="n">LoopItem</span> <span class="n">item</span><span class="o">)</span> <span class="o">{</span> <span class="kt">int</span> <span class="n">index</span> <span class="o">=</span> <span class="o">(</span><span class="n">item</span><span class="o">.</span><span class="na">getIteration</span><span class="o">()</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="o">);</span> - <span class="n">String</span> <span class="n">fragmentId</span> <span class="o">=</span> <span class="s">"fragment"</span> <span class="o">+</span> <span class="n">index</span><span class="o">;</span> + <span class="n">String</span> <span class="n">fragmentId</span> <span class="o">=</span> <span class="s">"fragment"</span> <span class="o">+</span> <span class="n">index</span><span class="o">;</span> <span class="k">if</span> <span class="o">(</span><span class="n">index</span> <span class="o">==</span> <span class="mi">1</span><span class="o">)</span> <span class="o">{</span> - <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Fragment1</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">));</span> + <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Fragment1</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">));</span> <span class="o">}</span> <span class="k">else</span> <span class="o">{</span> - <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="nf">Fragment</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">,</span> <span class="n">Index</span><span class="o">.</span><span class="na">this</span><span class="o">));</span> + <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Fragment</span><span class="o">(</span><span class="s">"panel"</span><span class="o">,</span> <span class="n">fragmentId</span><span class="o">,</span> <span class="n">Index</span><span class="o">.</span><span class="na">this</span><span class="o">));</span> <span class="o">}</span> <span class="o">}</span> <span class="o">};</span> <span class="n">add</span><span class="o">(</span><span class="n">loop</span><span class="o">);</span> <span class="o">}</span> -<span class="o">}</span></code></pre></div> +<span class="o">}</span></code></pre></figure> <p>The class <code>Fragment1</code> adds the label to itself. In the loopâs <code>populateItem</code> we alternate the fragments type between <code>Fragment</code> and <code>Fragment1</code>. This means that in the final page on one line youâll see <code>"panel 1 Hello, World!"</code> http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/learn/index.html ---------------------------------------------------------------------- diff --git a/content/learn/index.html b/content/learn/index.html index 443be44..f0cbf37 100644 --- a/content/learn/index.html +++ b/content/learn/index.html @@ -19,19 +19,19 @@ <div class="l-container"> <nav class="mainmenu"> <ul> - <!-- /start/quickstart.html || /learn --> + <!-- /start/quickstart.html || /learn/ --> <li class=""><a href="/start/quickstart.html">Quick Start</a></li> - <!-- /start/download.html || /learn --> + <!-- /start/download.html || /learn/ --> <li class=""><a href="/start/download.html">Download</a></li> - <!-- /learn || /learn --> - <li class="active"><a href="/learn">Documentation</a></li> - <!-- /help || /learn --> + <!-- /learn || /learn/ --> + <li class=""><a href="/learn">Documentation</a></li> + <!-- /help || /learn/ --> <li class=""><a href="/help">Support</a></li> - <!-- /contribute || /learn --> + <!-- /contribute || /learn/ --> <li class=""><a href="/contribute">Contribute</a></li> - <!-- /community || /learn --> + <!-- /community || /learn/ --> <li class=""><a href="/community">Community</a></li> - <!-- /apache || /learn --> + <!-- /apache || /learn/ --> <li class=""><a href="/apache">Apache</a></li> </ul> </nav> @@ -72,13 +72,13 @@ We also publish a news item on our website with the announcement, and it is also <p>Here are the most recent headlines:</p> <ul> <li> - <p><a href="/news/2015/10/25/wicket-7.1.0-released.html">Apache Wicket 7.1.0 released</a> <small>25 Oct 2015</small></p> + <p><a href="/news/2015/11/16/wicket-6-21-0-released.html">Apache Wicket 6.21.0 released</a> <small>16 Nov 2015</small></p> </li> <li> - <p><a href="/news/2015/10/24/wicket-1.5.14-released.html">Wicket 1.5.14 released</a> <small>24 Oct 2015</small></p> + <p><a href="/news/2015/11/15/wicket-1-4-x-eol.html">Apache Wicket 1.4.x end of life</a> <small>15 Nov 2015</small></p> </li> <li> - <p><a href="/news/2015/07/28/wicket-7.0-released.html">Apache Wicket v7.0 released</a> <small>28 Jul 2015</small></p> + <p><a href="/news/2015/10/25/wicket-7-1-0-released.html">Apache Wicket 7.1.0 released</a> <small>25 Oct 2015</small></p> </li> </ul> <p>The complete articles and all other news items are available in the <a href="/news">archives</a>.</p> http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/news/2009/07/30/wicket-1-3-7-released.html ---------------------------------------------------------------------- diff --git a/content/news/2009/07/30/wicket-1-3-7-released.html b/content/news/2009/07/30/wicket-1-3-7-released.html new file mode 100644 index 0000000..aa89da2 --- /dev/null +++ b/content/news/2009/07/30/wicket-1-3-7-released.html @@ -0,0 +1,155 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta charset="utf-8"> + <title>Apache Wicket 1.3.7 marks end of life for Wicket 1.3 | Apache Wicket</title> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + + <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" /> + <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" /> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" /> + + <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> + + </head> + + <body class=""> + <div class="header default"> + <div class="l-container"> +<nav class="mainmenu"> + <ul> + <!-- /start/quickstart.html || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/start/quickstart.html">Quick Start</a></li> + <!-- /start/download.html || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/start/download.html">Download</a></li> + <!-- /learn || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/learn">Documentation</a></li> + <!-- /help || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/help">Support</a></li> + <!-- /contribute || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/contribute">Contribute</a></li> + <!-- /community || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/community">Community</a></li> + <!-- /apache || /news/2009/07/30/wicket-1-3-7-released.html --> + <li class=""><a href="/apache">Apache</a></li> + </ul> +</nav> + <div class="logo"> + <a href="/"><img src="/img/logo-apachewicket-white.svg" alt="Apache Wicket"></a> +</div> + </div> +</div> +<main> + <div class="l-container"> + <header class="l-full preamble"> + <h1>Apache Wicket 1.3.7 marks end of life for Wicket 1.3</h1> + </header> + <section class="l-one-third right"> + <div id="toc" class="toc"><div id="toc-title"><h2>Table of Contents</h2></div><ul><li class="toc--level-1 toc--section-1"><a href="#apache-wicket-137"><span class="toc-number">1</span> <span class="toc-text">Apache Wicket 1.3.7</span></a><ul><li class="toc--level-2 toc--section-2"><a href="#this-release"><span class="toc-number">1.1</span> <span class="toc-text">This release</span></a></li><li class="toc--level-2 toc--section-3"><a href="#migrating-from-12"><span class="toc-number">1.2</span> <span class="toc-text">Migrating from 1.2</span></a></li><li class="toc--level-2 toc--section-4"><a href="#downloading-the-release"><span class="toc-number">1.3</span> <span class="toc-text">Downloading the release</span></a></li><li class="toc--level-2 toc--section-5"><a href="#validating-the-release"><span class="toc-number">1.4</span> <span class="toc-text">Validating the release</span></a></li><li class="toc--level-2 toc--section-6"><a href="#reporting-bugs"><span class="toc-num ber">1.5</span> <span class="toc-text">Reporting bugs</span></a></li><li class="toc--level-2 toc--section-7"><a href="#the-distribution"><span class="toc-number">1.6</span> <span class="toc-text">The distribution</span></a></li><li class="toc--level-2 toc--section-8"><a href="#release-notes"><span class="toc-number">1.7</span> <span class="toc-text">Release Notes</span></a></li></ul></li></ul></div> + </section> + <section class="l-two-third left"> + <div class="l-full"> + <p class="meta">30 Jul 2009</p> + <p>The Apache Wicket team is proud to present the release of Apache Wicket +1.3.7. This will be the last feature release for the 1.3.x branch. Going +forward, only security fixes will be released in the 1.3.x branch - meaning +that 1.3.7 may be the last release in this branch. All users are encouraged +to upgrade to 1.4.0 as soon as possible. As work begins on 1.5 in the near +future, we will be supporting 1.4.x and 1.5.x.</p> +<p>Eager people click here to download the distribution, others can read +further:</p> +<ul> + <li><a href="http://www.apache.org/dyn/closer.cgi/wicket/1.3.7">http://www.apache.org/dyn/closer.cgi/wicket/1.3.7</a></li> +</ul> +<p>We thank you for your patience and support.</p> +<p>The Wicket Team</p> +<h2 id="apache-wicket-137">Apache Wicket 1.3.7</h2> +<p>Apache Wicket is a component oriented Java web application framework. With +proper mark-up/logic separation, a POJO data model, and a refreshing lack of +XML, Apache Wicket makes developing web-apps simple and enjoyable again. Swap +the boilerplate, complex debugging and brittle code for powerful, reusable +components written with plain Java and HTML.</p> +<p>You can find out more about Apache Wicket on <a href="http://wicket.apache.org">our website</a></p> +<h3 id="this-release">This release</h3> +<p>This will be the last feature release for the 1.3.x branch. Going forward, +only security fixes will be released in the 1.3.x branch - meaning that 1.3.7 +may be the last release in this branch. All users are encouraged to upgrade +to 1.4.0 as soon as possible. As work begins on 1.5 in the near future, we +will be supporting 1.4.x and 1.5.x.</p> +<h3 id="migrating-from-12">Migrating from 1.2</h3> +<p>If you are coming from Wicket 1.2, you really want to read our migration +guide, found on the wiki:</p> +<p>https://cwiki.apache.org/confluence/display/WICKET/Migrating+to+Wicket+1.3</p> +<h3 id="downloading-the-release">Downloading the release</h3> +<p>You can download the release from the official Apache mirror system, and you +can find it through the following link:</p> +<p>http://www.apache.org/dyn/closer.cgi/wicket/1.3.7/</p> +<p>For the Maven and Ivy fans out there: update your pomâs to the following, and +everything will be downloaded automatically:</p> +<figure class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><dependency></span> + <span class="nt"><groupId></span>org.apache.wicket<span class="nt"></groupId></span> + <span class="nt"><artifactId></span>wicket<span class="nt"></artifactId></span> + <span class="nt"><version></span>1.3.7<span class="nt"></version></span> +<span class="nt"></dependency></span></code></pre></figure> +<p>Substitute the artifact ID with the projects of your liking to get the other +projects.</p> +<p>Please note that we donât prescribe a Logging implementation for SLF4J. You +need to specify yourself which one you prefer. Read more about SLF4J here: +http://slf4j.org</p> +<h3 id="validating-the-release">Validating the release</h3> +<p>The release has been signed by Igor Vaynberg, your release manager for today. +The public key can be found in the KEYS file in the download area. Download +the KEYS file only from the Apache website.</p> +<p>http://www.apache.org/dist/wicket/1.3.7/KEYS</p> +<p>Instructions on how to validate the release can be found here:</p> +<p>http://www.apache.org/dev/release-signing.html#check-integrity</p> +<h3 id="reporting-bugs">Reporting bugs</h3> +<p>In case you do encounter a bug, we would appreciate a report in our JIRA:</p> +<p>http://issues.apache.org/jira/browse/WICKET</p> +<h3 id="the-distribution">The distribution</h3> +<p>In the distribution you will find a README. The README contains instructions +on how to build from source yourself. You also find a CHANGELOG-1.3 which +contains a list of all things that have been fixed, added and/or removed +since Wicket 1.3.0.</p> +<h3 id="release-notes">Release Notes</h3> +<h4 id="bug">Bug</h4> +<ul> + <li><a href="https://issues.apache.org/jira/browse/WICKET-1912">WICKET-1912</a> - StatelessForm problems with query string</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-1922">WICKET-1922</a> - AbstractTree - setting root to null causes NullPointerException</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-1960">WICKET-1960</a> - AutoCompleteTextField - gives a type mismatch error on IE - version wicket-1.4-rc1</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-1992">WICKET-1992</a> - SharedResourceRequestTarget allows access to almost arbitrary files under WEB-INF.</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2215">WICKET-2215</a> - WebClientInfo does not set browerMajorVersion for IE8</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2252">WICKET-2252</a> - Autocomplete text fields donât call existing JavaScript event handlers properly</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2268">WICKET-2268</a> - NullPointerException NPE in DiskPageStore after Session Timeout</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2289">WICKET-2289</a> - AutoCompleteBehavior: Selected input not modiefied when selected with keyboard</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2308">WICKET-2308</a> - Append lastmodified to Resources shouldnt append when the resource is a directory (ends with /)</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2313">WICKET-2313</a> - BaseWicketTester doesnât invoke Application.newAjaxRequestTarget for ajax request target</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2337">WICKET-2337</a> - IndexOutOfBoundsException when PropertyResolver is using an invalid list index</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2354">WICKET-2354</a> - PropertyModel does not support index only property (â[0]â)</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2371">WICKET-2371</a> - jre 1.5 method used in wicket-extensions</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2384">WICKET-2384</a> - OutOfMemoryError occur for memory leak on FeedbackPanel & FeedbackMessages</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2385">WICKET-2385</a> - BigDecimalConverter uses jdk5</li> +</ul> +<h4 id="improvement">Improvement</h4> +<ul> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2168">WICKET-2168</a> - TableTree.html is not XHTML valid</li> + <li><a href="https://issues.apache.org/jira/browse/WICKET-2315">WICKET-2315</a> - Backport PageReference from trunk</li> +</ul> +</div> + </section> + </div> +</main> + <footer class="l-container"> + <div class="l-full"> + <img height="60px" src="/img/asf_logo.gif" style="float:left"> + Copyright © 2015 â The Apache Software Foundation. Apache Wicket, + Wicket, Apache, the Apache feather logo, and the Apache Wicket + project logo are trademarks of The Apache Software Foundation. All + other marks mentioned may be trademarks or registered trademarks of + their respective owners. +</div> + </footer> + </body> + +</html> http://git-wip-us.apache.org/repos/asf/wicket-site/blob/2118a439/content/news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html ---------------------------------------------------------------------- diff --git a/content/news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html b/content/news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html new file mode 100644 index 0000000..48d774b --- /dev/null +++ b/content/news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html @@ -0,0 +1,157 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta charset="utf-8"> + <title>Apache Wicket 1.4 takes typesafety to the next level | Apache Wicket</title> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + + <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" /> + <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" /> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" /> + + <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> + + </head> + + <body class=""> + <div class="header default"> + <div class="l-container"> +<nav class="mainmenu"> + <ul> + <!-- /start/quickstart.html || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/start/quickstart.html">Quick Start</a></li> + <!-- /start/download.html || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/start/download.html">Download</a></li> + <!-- /learn || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/learn">Documentation</a></li> + <!-- /help || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/help">Support</a></li> + <!-- /contribute || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/contribute">Contribute</a></li> + <!-- /community || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/community">Community</a></li> + <!-- /apache || /news/2009/07/30/wicket-1-4-takes-typesafety-to-the-next-level.html --> + <li class=""><a href="/apache">Apache</a></li> + </ul> +</nav> + <div class="logo"> + <a href="/"><img src="/img/logo-apachewicket-white.svg" alt="Apache Wicket"></a> +</div> + </div> +</div> +<main> + <div class="l-container"> + <header class="l-full preamble"> + <h1>Apache Wicket 1.4 takes typesafety to the next level</h1> + </header> + <section class="l-one-third right"> + <div id="toc" class="toc"><div id="toc-title"><h2>Table of Contents</h2></div><ul><li class="toc--level-1 toc--section-1"><a href="#download-apache-wicket-14"><span class="toc-number">1</span> <span class="toc-text">Download Apache Wicket 1.4</span></a></li><li class="toc--level-1 toc--section-2"><a href="#most-notable-changes"><span class="toc-number">2</span> <span class="toc-text">Most notable changes</span></a></li><li class="toc--level-1 toc--section-3"><a href="#increased-type-safety"><span class="toc-number">3</span> <span class="toc-text">Increased type safety</span></a></li><li class="toc--level-1 toc--section-4"><a href="#removal-of-default-model-from-component"><span class="toc-number">4</span> <span class="toc-text">Removal of default model from component</span></a></li></ul></div> + </section> + <section class="l-two-third left"> + <div class="l-full"> + <p class="meta">30 Jul 2009</p> + <p>The Apache Wicket project is proud to announce the release of Apache Wicket +1.4. Apache Wicket is an open source, component oriented Java web application +framework. With overwhelming support from the user community, this release +marks a departure from the past where we leave Java 1.4 behind and we require +Java 5 as the minimum JDK version. By moving to Java 5 as the required +minimum platform, we were able to utilize Java 5 idioms and increase the type +safety of our APIs. Using Java generics you can now write typesafe web +applications and create typesafe, self documenting, reusable custom +components.</p> +<h2 id="download-apache-wicket-14">Download Apache Wicket 1.4</h2> +<p>You can download the release here: +http://www.apache.org/dyn/closer.cgi/wicket/1.4.0</p> +<p>Or use this in your Maven pomâs to upgrade to the new version:</p> +<figure class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><dependency></span> + <span class="nt"><groupId></span>org.apache.wicket<span class="nt"></groupId></span> + <span class="nt"><artifactId></span>wicket<span class="nt"></artifactId></span> + <span class="nt"><version></span>1.4.0<span class="nt"></version></span> +<span class="nt"></dependency></span></code></pre></figure> +<p>You will need to upgrade all modules (i.e. wicket, wicket-extensions) to +their 1.4 counterparts. It is not possible to mix Wicket 1.3 libraries with +1.4 libraries due to API changes.</p> +<h2 id="most-notable-changes">Most notable changes</h2> +<p>From all the changes that went into this release, the following are the most +important ones:</p> +<ul> + <li>Generified <code>IModel</code> interface and implementations increases type safety in your Wicket applications</li> + <li><code>Component#getModel()</code> and <code>Component#setModel()</code> have been renamed to <code>getDefaultModel()</code> and <code>setDefaultModel()</code> to better support generified models</li> + <li>The Spring modules have been merged (wicket-spring-annot is now obsolete, all you need is wicket-spring)</li> + <li>Many APIâs have been altered to better work with Java 5âs idioms</li> + <li>Wicket jars are now packaged with metadata that makes them OSGI bundles</li> +</ul> +<p>Apart from these changes, the release is mostly compatible with Wicket 1.3 +and upgrading shouldnât take too long. Early adopters report about a days +work to upgrade medium to large applications to Wicket 1.4. Read the +migration guide to learn more about the changes in our APIs. To learn more +about all the improvements and new features that went into this release, +check the solved issue list in our JIRA instance.</p> +<h2 id="increased-type-safety">Increased type safety</h2> +<p>Moving towards Java 5 has given us the opportunity to utilize generics and +clarify our APIâs. For example, take a look at <code>DropDownChoice</code>âone of the +components with the most questions on our list prior to 1.4. A +<code>DropDownChoice</code> component is a form component that displays a list of +available choices in a drop down box, and allows one selection to be made. +DropDownChoice components are typically used to display a list of countries, +nationalities, credit card processors, etc.</p> +<p>The signature of a constructor for the <code>DropDownChoice</code> component in Wicket +1.3 was:</p> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">DropDownChoice</span> <span class="kd">extends</span> <span class="o">...</span> + <span class="kd">public</span> <span class="n">DropDownChoice</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">,</span> <span class="n">IModel</span> <span class="n">model</span><span class="o">,</span> <span class="n">IModel</span> <span class="n">choices</span><span class="o">)</span> +<span class="o">}</span></code></pre></figure> +<p>As you can see, this constructor doesnât give much insight into what goes +where (other than the names of the parameters). The first parameter is the +component identifier, the second parameter is the model that contains the +selection, and the third parameter is a model that contains the list of +choices from which the user can select one. Youâll have to read the JavaDoc +to assign the right IModel values to the right parameters. Now take a look at +the same constructor, but now in Wicket 1.4. The signature for our generified +constructor looks like the following example.</p> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="o"><</span><span class="n">T</span><span class="o">></span> <span class="n">DropDownChoice</span> <span class="kd">extends</span> <span class="o">...</span> + <span class="kd">public</span> <span class="n">DropDownChoice</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">,</span> <span class="n">IModel</span><span class="o"><</span><span class="n">T</span><span class="o">></span> <span class="n">model</span><span class="o">,</span> <span class="n">IModel</span><span class="o"><?</span> <span class="kd">extends</span> <span class="n">List</span><span class="o"><?</span> <span class="kd">extends</span> <span class="n">T</span><span class="o">>></span> <span class="n">choices</span><span class="o">)</span> +<span class="o">}</span></code></pre></figure> +<p>Here we communicate that the first <code>IModel</code> parameter is a <code>T</code>, which is the +single value that will be provided when the <code>DropDownChoice</code> selects one +value. The second parameter provides a <code>List</code> of objects that extend <code>T</code>, the +choices from which to select one value. This was not apparent in the Wicket +1.3 API, and the type safety brought by generics make this much more clear, +albeit much more verbose.</p> +<h2 id="removal-of-default-model-from-component">Removal of default model from component</h2> +<p>In Wicket 1.3 each component had by default a model: a <code>Label</code> had a model, a +<code>Link</code> and even <code>WebMarkupContainer</code> had a model property (all because they +extend <code>Component</code> which has a model property). When we generified <code>IModel</code>, +this had averse effects on <code>Component</code>: suddenly all components had to be +generified and had to take the type parameter of the model that was +associated with it. But that poses problems for components that either do not +use a model or use two different model types: which one should be in the +lead? We chose to generify only the components that clearly benefited from +the extra type information, leading to clean code like this:</p> +<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">ListView</span><span class="o"><</span><span class="n">Person</span><span class="o">></span> <span class="n">peopleListView</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ListView</span><span class="o"><</span><span class="n">Person</span><span class="o">>(</span><span class="s">"people"</span><span class="o">,</span> <span class="n">people</span><span class="o">)</span> <span class="o">{</span> + <span class="kd">protected</span> <span class="kt">void</span> <span class="n">populateItem</span><span class="o">(</span><span class="n">ListItem</span><span class="o"><</span><span class="n">Person</span><span class="o">></span> <span class="n">item</span><span class="o">)</span> <span class="o">{</span> + <span class="n">item</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">Link</span><span class="o"><</span><span class="n">Person</span><span class="o">>(</span><span class="s">"editPerson"</span><span class="o">,</span> <span class="n">item</span><span class="o">.</span><span class="na">getModel</span><span class="o">()){</span> + <span class="kd">public</span> <span class="kt">void</span> <span class="n">onClick</span><span class="o">()</span> <span class="o">{</span> + <span class="n">Person</span> <span class="n">p</span> <span class="o">=</span> <span class="n">getModelObject</span><span class="o">();</span> + <span class="n">setResponsePage</span><span class="o">(</span><span class="k">new</span> <span class="n">EditPersonPage</span><span class="o">(</span><span class="n">p</span><span class="o">));</span> + <span class="o">}</span> + <span class="o">});</span> + <span class="o">}</span> + <span class="o">};</span></code></pre></figure> +</div> + </section> + </div> +</main> + <footer class="l-container"> + <div class="l-full"> + <img height="60px" src="/img/asf_logo.gif" style="float:left"> + Copyright © 2015 â The Apache Software Foundation. Apache Wicket, + Wicket, Apache, the Apache feather logo, and the Apache Wicket + project logo are trademarks of The Apache Software Foundation. All + other marks mentioned may be trademarks or registered trademarks of + their respective owners. +</div> + </footer> + </body> + +</html>
