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 2014/04/24 21:41:18 UTC
svn commit: r1589849 [3/6] - in /wicket/common/site/trunk/_site/guide/guide:
./ pages/ src/docs/guide/ src/docs/guide/forms2/ src/docs/guide/helloWorld/
src/docs/img/
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_4.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_4.html Thu Apr 24 19:41:13 2014
@@ -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>12.4 Submit form with an IFormSubmittingComponent 6.x</title>
+ <title>12.4 Validation with JSR 303 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.4 Submit form with an IFormSubmittingComponent - Reference Documentation</h1>
+ <h1>12.4 Validation with JSR 303 - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,55 +159,30 @@ function addJsClass() {
-<h2 id="forms2_4">12.4 Submit form with an IFormSubmittingComponent</h2>
-<p class="paragraph"/>Besides submitting forms with a standard HTML submit button, Wicket allows us to use special components which implement interface IFormSubmittingComponent. This entity is a subinterface of IFormSubmitter:<p class="paragraph"/><img border="0" class="center" src="../img/class-diag-IFormSubmittingComponent.png"></img><p class="paragraph"/>At the beginning of this chapter we have seen that form processing is started by process method which takes as input an instance of IFormSubmitter. This parameter corresponds to the IFormSubmittingComponent clicked by a user to submit the form and it is null if we have used a standard HTML submit button (like we have done so far).<p class="paragraph"/>A submitting component is added to a form just like any other child component using method add(Component...).<p class="paragraph"/>A form can have any number of submitting components and we can specify which one among them is the default one by calling the Form's method setDefaultB
utton(IFormSubmittingComponent  component). The default submitter is the one that will be used when user presses 'Enter' key in a field of the form. In order to make the default button work, Wicket will add to our form a hidden <div> tag containing a text field and a submit button with some JavaScript code to trigger it:<p class="paragraph"/><div class="code"><pre><div style=<span class="java-quote">"width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"</span>>
- <input type=<span class="java-quote">"text"</span> autocomplete=<span class="java-quote">"off"</span>/>
- <input type=<span class="java-quote">"submit"</span> name=<span class="java-quote">"submit2"</span> onclick=<span class="java-quote">" <span class="java-keyword">var</span> b=document...."</span>/>
-</div></pre></div><p class="paragraph"/>Just like Wicket forms, interface IFormSubmitter defines methods onSubmit and onError. These two methods have the priority over the namesake methods of the form, meaning that when a form is submitted with an IFormSubmitter, the onSubmit of the submitter is called before the one of the form. Similarly, if validation errors occurs during the first step of form processing, submitter's method onError is called before the form's one.<p class="paragraph"/><blockquote class="note">
-Starting with Wicket version 6.0 interface IFormSubmitter defines a further callback method called onAfterSubmit(). This method is called after form's method onSubmit() has been executed.
-</blockquote><p class="paragraph"/><h3>Components Button and SubmitLink</h3><p class="paragraph"/>Component <code>org.apache.wicket.markup.html.form.Button</code> is a basic implementation of a form submitter. It can be used with either the <input> or <button> tags. The string model received as input by its constructor is used as button label and it will be the value of the markup attribute value.<p class="paragraph"/>In the following snippet we have a form with two submit buttons bound to an <input> tag. One of them is set as default button and both have a string model for the label:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><body>
- <form wicket:id=<span class="java-quote">"form"</span>>
- Username: <input type=<span class="java-quote">"text"</span> wicket:id=<span class="java-quote">"username"</span>/>
- <br/>
- <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit1"</span>/>
- <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit2"</span>/>
- </form>
-</body></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
- Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>);<p class="paragraph"/> form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"username"</span>, Model.of(<span class="java-quote">""</span>)));
- form.add(<span class="java-keyword">new</span> Button(<span class="java-quote">"submit1"</span>, Model.of(<span class="java-quote">"First submitter"</span>)));
- Button secondSubmitter;
- form.add(secondSubmitter = <span class="java-keyword">new</span> Button(<span class="java-quote">"submit2"</span>, Model.of(<span class="java-quote">"Second submitter"</span>)));<p class="paragraph"/> form.setDefaultButton(secondSubmitter);
- add(form);
- }
-}</pre></div><p class="paragraph"/><strong class="bold">Generated markup:</strong><p class="paragraph"/><div class="code"><pre><form wicket:id=<span class="java-quote">"form"</span> id=<span class="java-quote">"form1"</span> method=<span class="java-quote">"post"</span> action=<span class="java-quote">"?0-1.IFormSubmitListener-form"</span>>
- <div>
- …
- <!-- Code generated by Wicket to handle the <span class="java-keyword">default</span> button -->
- …
- </div>
- Username: <input type=<span class="java-quote">"text"</span> wicket:id=<span class="java-quote">"username"</span> value=<span class="java-quote">""</span> name=<span class="java-quote">"username"</span>/>
- <br/>
- <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit1"</span> name=<span class="java-quote">"submit1"</span> id=<span class="java-quote">"submit13"</span> value=<span class="java-quote">"First submitter"</span>/>
- <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit2"</span> name=<span class="java-quote">"submit2"</span> id=<span class="java-quote">"submit22"</span> value=<span class="java-quote">"Second submitter"</span>/>
-</form></pre></div><p class="paragraph"/>Another component that can be used to submit a form is <code>org.apache.wicket.markup.html.form.SubmitLink</code>. This component uses JavaScript to submit the form. Like the name suggests, the component can be used with the <a> tag but it can be also bound to any other tag that supports the event handler onclick. When used with the <a> tag, the JavaScript code needed to submit the form will be placed inside href attribute while with other tags the script will go inside the event handler onclick.<p class="paragraph"/>A notable difference between this component and Button is that SubmitLink can be placed outside the form it must submit. In this case we must specify the form to submit in its constructor:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><html xmlns:wicket=<span class="java-quote">"http://wicket.apache.org"</span>>
-<head>
- </head>
- <body>
- <form wicket:id=<span class="java-quote">"form"</span>>
- Password: <input type=<span class="java-quote">"password"</span> wicket:id=<span class="java-quote">"password"</span>/>
- <br/>
- </form>
- <button wicket:id=<span class="java-quote">"externalSubmitter"</span>>
- Submit
- </button>
- </body>
-</html></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
- Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>);<p class="paragraph"/> form.add(<span class="java-keyword">new</span> PasswordTextField(<span class="java-quote">"password"</span>, Model.of(<span class="java-quote">""</span>)));
- //specify the form to submit
- add(<span class="java-keyword">new</span> SubmitLink(<span class="java-quote">"externalSubmitter"</span>, form));
- add(form);
- }
-}</pre></div><p class="paragraph"/><h3>Disabling default form processing</h3><p class="paragraph"/>With an IFormSubmittingComponent we can choose to skip the default form submission process by setting the appropriate flag to false with the setDefaultFormProcessing method. When the default form processing is disabled only the submitter's onSubmit is called while form's validation and models updating are skipped.<p class="paragraph"/>This can be useful if we want to implement a âCancelâ button on our form which redirects user to another page without validating his/her input.<p class="paragraph"/>When we set this flag to false we can decide to manually invoke the form processing by calling the process(IFormSubmittingComponent) method.
+<h2 id="forms2_4">12.4 Validation with JSR 303</h2>
+Standard JSR 303 defines a set of annotations and APIs to validate our domain objects at field-level. Wicket has introduced an experimental support for this standard since version 6.4.0 and with version 6.14.0 it has became an official Wicket model (named <code>wicket-bean-validation</code>).
+In this paragraph we will see the basic steps needed to use JSR 303 validation in our Wicket application. Code snippets are from example project <code>JSR303validation</code>.<p class="paragraph"/>In the example application we have a form to insert the data for a new <code>Person</code> bean and its relative <code>Address</code>. The code for class <code>Person</code> is the following<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class Person <span class="java-keyword">implements</span> Serializable{<p class="paragraph"/> @NotNull
+ <span class="java-keyword">private</span> <span class="java-object">String</span> name;<p class="paragraph"/> //regular expression to validate an email address
+ @Pattern(regexp = <span class="java-quote">"^[_A-Za-z0-9-]+(.[_A-Za-z0-9-]+)*[A-Za-z0-9-]+(.[A-Za-z0-9-]+)*((.[A-Za-z]{2,}){1}$)"</span>)
+ <span class="java-keyword">private</span> <span class="java-object">String</span> email;<p class="paragraph"/> @Range(min = 18, max = 150)
+ <span class="java-keyword">private</span> <span class="java-object">int</span> age;<p class="paragraph"/> <code>Past </code>NotNull
+ <span class="java-keyword">private</span> Date birthDay;<p class="paragraph"/> @NotNull
+ <span class="java-keyword">private</span> Address address;
+}</pre></div><p class="paragraph"/>You can note the JSR 303 annotations used in the code above to declare validation constraints on class fields. Class <code>Address</code> has the following code:<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class Address <span class="java-keyword">implements</span> Serializable {<p class="paragraph"/> @NotNull
+ <span class="java-keyword">private</span> <span class="java-object">String</span> city;<p class="paragraph"/> @NotNull
+ <span class="java-keyword">private</span> <span class="java-object">String</span> street;<p class="paragraph"/> @Pattern(regexp = "\\d+<span class="java-quote">", message = "</span>{address.invalidZipCode}")
+ <span class="java-keyword">private</span> <span class="java-object">String</span> zipCode;
+}</pre></div><p class="paragraph"/>You might have noted that in class <code>Address</code> we have used annotation <code>Pattern using also attribute </code>message<code> which contains the key of the bundle to use for validation message. Our custom bundle is contained inside </code>HomePage.properties@:<p class="paragraph"/><div class="code"><pre>address.invalidZipCode=The inserted zip code is not valid.</pre></div><p class="paragraph"/>To tell Wicket to use JSR 303, we must register bean validator on Application's startup:<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class WicketApplication <span class="java-keyword">extends</span> WebApplication {
+ @Override
+ <span class="java-keyword">public</span> void init(){
+ <span class="java-keyword">super</span>.init();<p class="paragraph"/> <span class="java-keyword">new</span> BeanValidationConfiguration().configure(<span class="java-keyword">this</span>);
+ }
+}</pre></div><p class="paragraph"/>The last step to harness JSR 303 annotations is to add validator <code>org.apache.wicket.bean.validation.PropertyValidator</code> to our corresponding form components:<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
+ <span class="java-keyword">super</span>(parameters);<p class="paragraph"/> setDefaultModel(<span class="java-keyword">new</span> CompoundPropertyModel<Person>(<span class="java-keyword">new</span> Person()));<p class="paragraph"/> Form<<span class="java-object">Void</span>> form = <span class="java-keyword">new</span> Form<<span class="java-object">Void</span>>(<span class="java-quote">"form"</span>);<p class="paragraph"/> form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"name"</span>).add(<span class="java-keyword">new</span> PropertyValidator()));
+ form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"email"</span>).add(<span class="java-keyword">new</span> PropertyValidator()));
+ form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"age"</span>).add(<span class="java-keyword">new</span> PropertyValidator()));
+ //…
+}</pre></div><p class="paragraph"/>Now we can run our application an see that JSR 303 annotations are fully effective:<p class="paragraph"/><img border="0" class="center" src="../img/jsr303-form-validation.png"></img><p class="paragraph"/>
<div style="clear:both;margin-top:15px;"></div>
@@ -236,7 +211,7 @@ Starting with Wicket version 6.0 interfa
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_5.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_5.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_5.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_5.html Thu Apr 24 19:41:13 2014
@@ -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>12.5 Nested forms 6.x</title>
+ <title>12.5 Submit form with an IFormSubmittingComponent 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.5 Nested forms - Reference Documentation</h1>
+ <h1>12.5 Submit form with an IFormSubmittingComponent - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,17 +159,55 @@ function addJsClass() {
-<h2 id="forms2_5">12.5 Nested forms</h2>
-<p class="paragraph"/>As you might already known, HTLM doesn't allow to have nested forms. However with Wicket we can overcome this limitation by adding one or more form components to a parent form.<p class="paragraph"/>This can be useful if we want to split a big form into smaller ones in order to reuse them and to better distribute responsibilities among different components.
-Forms can be nested to an arbitrary level:<p class="paragraph"/><div class="code"><pre><form wicket:id=<span class="java-quote">"outerForm"</span>>
- …
- <form wicket:id=<span class="java-quote">"innerForm"</span>>
- …
- <form wicket:id=<span class="java-quote">"veryInnerForm"</span>>
- …
- </form>
- </form>
-</form></pre></div><p class="paragraph"/>When a form is submitted also its nested forms are submitted and they participate in the validation step. This means that if a nested form contains invalid input values, the outer form won't be submitted. On the contrary, nested forms can be singularly submitted without depending on the status of their outer form.<p class="paragraph"/>To submit a parent form when one of its children forms is submitted, we must override its method wantSubmitOnNestedFormSubmit and make it return true.
+<h2 id="forms2_5">12.5 Submit form with an IFormSubmittingComponent</h2>
+<p class="paragraph"/>Besides submitting forms with a standard HTML submit button, Wicket allows us to use special components which implement interface IFormSubmittingComponent. This entity is a subinterface of IFormSubmitter:<p class="paragraph"/><img border="0" class="center" src="../img/class-diag-IFormSubmittingComponent.png"></img><p class="paragraph"/>At the beginning of this chapter we have seen that form processing is started by process method which takes as input an instance of IFormSubmitter. This parameter corresponds to the IFormSubmittingComponent clicked by a user to submit the form and it is null if we have used a standard HTML submit button (like we have done so far).<p class="paragraph"/>A submitting component is added to a form just like any other child component using method add(Component...).<p class="paragraph"/>A form can have any number of submitting components and we can specify which one among them is the default one by calling the Form's method setDefaultB
utton(IFormSubmittingComponent  component). The default submitter is the one that will be used when user presses 'Enter' key in a field of the form. In order to make the default button work, Wicket will add to our form a hidden <div> tag containing a text field and a submit button with some JavaScript code to trigger it:<p class="paragraph"/><div class="code"><pre><div style=<span class="java-quote">"width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hidden"</span>>
+ <input type=<span class="java-quote">"text"</span> autocomplete=<span class="java-quote">"off"</span>/>
+ <input type=<span class="java-quote">"submit"</span> name=<span class="java-quote">"submit2"</span> onclick=<span class="java-quote">" <span class="java-keyword">var</span> b=document...."</span>/>
+</div></pre></div><p class="paragraph"/>Just like Wicket forms, interface IFormSubmitter defines methods onSubmit and onError. These two methods have the priority over the namesake methods of the form, meaning that when a form is submitted with an IFormSubmitter, the onSubmit of the submitter is called before the one of the form. Similarly, if validation errors occurs during the first step of form processing, submitter's method onError is called before the form's one.<p class="paragraph"/><blockquote class="note">
+Starting with Wicket version 6.0 interface IFormSubmitter defines a further callback method called onAfterSubmit(). This method is called after form's method onSubmit() has been executed.
+</blockquote><p class="paragraph"/><h3>Components Button and SubmitLink</h3><p class="paragraph"/>Component <code>org.apache.wicket.markup.html.form.Button</code> is a basic implementation of a form submitter. It can be used with either the <input> or <button> tags. The string model received as input by its constructor is used as button label and it will be the value of the markup attribute value.<p class="paragraph"/>In the following snippet we have a form with two submit buttons bound to an <input> tag. One of them is set as default button and both have a string model for the label:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><body>
+ <form wicket:id=<span class="java-quote">"form"</span>>
+ Username: <input type=<span class="java-quote">"text"</span> wicket:id=<span class="java-quote">"username"</span>/>
+ <br/>
+ <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit1"</span>/>
+ <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit2"</span>/>
+ </form>
+</body></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
+ Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>);<p class="paragraph"/> form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"username"</span>, Model.of(<span class="java-quote">""</span>)));
+ form.add(<span class="java-keyword">new</span> Button(<span class="java-quote">"submit1"</span>, Model.of(<span class="java-quote">"First submitter"</span>)));
+ Button secondSubmitter;
+ form.add(secondSubmitter = <span class="java-keyword">new</span> Button(<span class="java-quote">"submit2"</span>, Model.of(<span class="java-quote">"Second submitter"</span>)));<p class="paragraph"/> form.setDefaultButton(secondSubmitter);
+ add(form);
+ }
+}</pre></div><p class="paragraph"/><strong class="bold">Generated markup:</strong><p class="paragraph"/><div class="code"><pre><form wicket:id=<span class="java-quote">"form"</span> id=<span class="java-quote">"form1"</span> method=<span class="java-quote">"post"</span> action=<span class="java-quote">"?0-1.IFormSubmitListener-form"</span>>
+ <div>
+ …
+ <!-- Code generated by Wicket to handle the <span class="java-keyword">default</span> button -->
+ …
+ </div>
+ Username: <input type=<span class="java-quote">"text"</span> wicket:id=<span class="java-quote">"username"</span> value=<span class="java-quote">""</span> name=<span class="java-quote">"username"</span>/>
+ <br/>
+ <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit1"</span> name=<span class="java-quote">"submit1"</span> id=<span class="java-quote">"submit13"</span> value=<span class="java-quote">"First submitter"</span>/>
+ <input type=<span class="java-quote">"submit"</span> wicket:id=<span class="java-quote">"submit2"</span> name=<span class="java-quote">"submit2"</span> id=<span class="java-quote">"submit22"</span> value=<span class="java-quote">"Second submitter"</span>/>
+</form></pre></div><p class="paragraph"/>Another component that can be used to submit a form is <code>org.apache.wicket.markup.html.form.SubmitLink</code>. This component uses JavaScript to submit the form. Like the name suggests, the component can be used with the <a> tag but it can be also bound to any other tag that supports the event handler onclick. When used with the <a> tag, the JavaScript code needed to submit the form will be placed inside href attribute while with other tags the script will go inside the event handler onclick.<p class="paragraph"/>A notable difference between this component and Button is that SubmitLink can be placed outside the form it must submit. In this case we must specify the form to submit in its constructor:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><html xmlns:wicket=<span class="java-quote">"http://wicket.apache.org"</span>>
+<head>
+ </head>
+ <body>
+ <form wicket:id=<span class="java-quote">"form"</span>>
+ Password: <input type=<span class="java-quote">"password"</span> wicket:id=<span class="java-quote">"password"</span>/>
+ <br/>
+ </form>
+ <button wicket:id=<span class="java-quote">"externalSubmitter"</span>>
+ Submit
+ </button>
+ </body>
+</html></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
+ Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>);<p class="paragraph"/> form.add(<span class="java-keyword">new</span> PasswordTextField(<span class="java-quote">"password"</span>, Model.of(<span class="java-quote">""</span>)));
+ //specify the form to submit
+ add(<span class="java-keyword">new</span> SubmitLink(<span class="java-quote">"externalSubmitter"</span>, form));
+ add(form);
+ }
+}</pre></div><p class="paragraph"/><h3>Disabling default form processing</h3><p class="paragraph"/>With an IFormSubmittingComponent we can choose to skip the default form submission process by setting the appropriate flag to false with the setDefaultFormProcessing method. When the default form processing is disabled only the submitter's onSubmit is called while form's validation and models updating are skipped.<p class="paragraph"/>This can be useful if we want to implement a âCancelâ button on our form which redirects user to another page without validating his/her input.<p class="paragraph"/>When we set this flag to false we can decide to manually invoke the form processing by calling the process(IFormSubmittingComponent) method.
<div style="clear:both;margin-top:15px;"></div>
@@ -198,7 +236,7 @@ Forms can be nested to an arbitrary leve
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_6.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_6.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_6.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_6.html Thu Apr 24 19:41:13 2014
@@ -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>12.6 Multi-line text input 6.x</title>
+ <title>12.6 Nested forms 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.6 Multi-line text input - Reference Documentation</h1>
+ <h1>12.6 Nested forms - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,8 +159,17 @@ function addJsClass() {
-<h2 id="forms2_6">12.6 Multi-line text input</h2>
-<p class="paragraph"/>HTML provides a multi-line text input control with <textarea> tag. The Wicket counterpart for this kind of control is <code>org.apache.wicket.markup.html.form.TextArea</code> component:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><textarea wicket:id=<span class="java-quote">"description"</span> rows=<span class="java-quote">"5"</span> cols=<span class="java-quote">"40"</span>></textarea></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre>form.add(<span class="java-keyword">new</span> TextArea(<span class="java-quote">"description"</span>, Model.of(<span class="java-quote">""</span>)));</pre></div><p class="paragraph"/>Component TextArea is used just like any other single-line text field. To specify the size of the text area we can write attributes rows and cols directly in the markup file or
we can create new attribute modifiers and add them to our TextArea component.
+<h2 id="forms2_6">12.6 Nested forms</h2>
+<p class="paragraph"/>As you might already known, HTLM doesn't allow to have nested forms. However with Wicket we can overcome this limitation by adding one or more form components to a parent form.<p class="paragraph"/>This can be useful if we want to split a big form into smaller ones in order to reuse them and to better distribute responsibilities among different components.
+Forms can be nested to an arbitrary level:<p class="paragraph"/><div class="code"><pre><form wicket:id=<span class="java-quote">"outerForm"</span>>
+ …
+ <form wicket:id=<span class="java-quote">"innerForm"</span>>
+ …
+ <form wicket:id=<span class="java-quote">"veryInnerForm"</span>>
+ …
+ </form>
+ </form>
+</form></pre></div><p class="paragraph"/>When a form is submitted also its nested forms are submitted and they participate in the validation step. This means that if a nested form contains invalid input values, the outer form won't be submitted. On the contrary, nested forms can be singularly submitted without depending on the status of their outer form.<p class="paragraph"/>To submit a parent form when one of its children forms is submitted, we must override its method wantSubmitOnNestedFormSubmit and make it return true.
<div style="clear:both;margin-top:15px;"></div>
@@ -189,7 +198,7 @@ function addJsClass() {
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_7.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_7.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_7.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_7.html Thu Apr 24 19:41:13 2014
@@ -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>12.7 File upload 6.x</title>
+ <title>12.7 Multi-line text input 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.7 File upload - Reference Documentation</h1>
+ <h1>12.7 Multi-line text input - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,45 +159,8 @@ function addJsClass() {
-<h2 id="forms2_7">12.7 File upload</h2>
-<p class="paragraph"/>Wicket supports file uploading with the FileUploadField component which must be used with the <input> tag whose type attribute must be set to "file". In order to send a file on form submission we must enable multipart mode calling MultiPart(true)on our form.<p class="paragraph"/>In the next example (project UploadSingleFile) we will see a form which allows users to upload a file into the temporary directory of the server (path /tmp on Unix/Linux systems):<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><html>
- <head>
- </head>
- <body>
- <h1>Upload your file here!</h1>
- <form wicket:id=<span class="java-quote">"form"</span>>
- <input type=<span class="java-quote">"file"</span> wicket:id=<span class="java-quote">"fileUploadField"</span>/>
- <input type=<span class="java-quote">"submit"</span> value=<span class="java-quote">"Upload"</span>/>
- </form>
- <div wicket:id=<span class="java-quote">"feedbackPanel"</span>>
- </div>
- </body>
-</html></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {
- <span class="java-keyword">private</span> FileUploadField fileUploadField;<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
- fileUploadField = <span class="java-keyword">new</span> FileUploadField(<span class="java-quote">"fileUploadField"</span>);<p class="paragraph"/> Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>){
- @Override
- <span class="java-keyword">protected</span> void onSubmit() {
- <span class="java-keyword">super</span>.onSubmit();<p class="paragraph"/> FileUpload fileUpload = fileUploadField.getFileUpload();<p class="paragraph"/> <span class="java-keyword">try</span> {
- File file = <span class="java-keyword">new</span> File(<span class="java-object">System</span>.getProperty(<span class="java-quote">"java.io.tmpdir"</span>) + <span class="java-quote">"/"</span> +
- fileUpload.getClientFileName());<p class="paragraph"/> fileUpload.writeTo(file);
- } <span class="java-keyword">catch</span> (IOException e) {
- e.printStackTrace();
- }
- }
- };<p class="paragraph"/> form.setMultiPart(<span class="java-keyword">true</span>);
- //set a limit <span class="java-keyword">for</span> uploaded file's size
- form.setMaxSize(Bytes.kilobytes(100));
- form.add(fileUploadField);
- add(<span class="java-keyword">new</span> FeedbackPanel(<span class="java-quote">"feedbackPanel"</span>));
- add(form);
- }
-}</pre></div><p class="paragraph"/>The code that copies the uploaded file to the temporary directory is inside the onSubmit method of the Form class. The uploaded file is handled with an instance of class FileUpload returned by the getFileUpload() method of the FileUploadField class. This class provides a set of methods to perform some common tasks like getting the name of the uploaded file (getClientFileName()), coping the file into a directory (writeTo(destinationFile)), calculating file digest (getDigest (digestAlgorithm)) and so on.<p class="paragraph"/>Form component can limit the size for uploaded files using its setMaxSize(size) method. In the example we have set this limit to 100 kb to prevent users from uploading files bigger than this size.<p class="paragraph"/><blockquote class="note">
-The maximum size for uploaded files can also be set at application's level using the setDefaultMaximumUploadSize(Bytes maxSize) method of the IApplicationSettings interface:<p class="paragraph"/><div class="code"><pre>@Override
-<span class="java-keyword">public</span> void init()
-{
- getApplicationSettings().setDefaultMaximumUploadSize(Bytes.kilobytes(100));
-}</pre></div>
-</blockquote><p class="paragraph"/><h3>Upload multiple files</h3><p class="paragraph"/>If we need to upload multiple files at once, we can use the MultiFileUploadField component which allows the user to select an arbitrary number of files to send on form submission.<p class="paragraph"/>An example showing how to use this component can be found in Wicket module wicket-examples in file MultiUploadPage.java. The live example is hosted at <a href="http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi" target="blank">http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi</a> .
+<h2 id="forms2_7">12.7 Multi-line text input</h2>
+<p class="paragraph"/>HTML provides a multi-line text input control with <textarea> tag. The Wicket counterpart for this kind of control is <code>org.apache.wicket.markup.html.form.TextArea</code> component:<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><textarea wicket:id=<span class="java-quote">"description"</span> rows=<span class="java-quote">"5"</span> cols=<span class="java-quote">"40"</span>></textarea></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre>form.add(<span class="java-keyword">new</span> TextArea(<span class="java-quote">"description"</span>, Model.of(<span class="java-quote">""</span>)));</pre></div><p class="paragraph"/>Component TextArea is used just like any other single-line text field. To specify the size of the text area we can write attributes rows and cols directly in the markup file or
we can create new attribute modifiers and add them to our TextArea component.
<div style="clear:both;margin-top:15px;"></div>
@@ -226,7 +189,7 @@ The maximum size for uploaded files can
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_8.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_8.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_8.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_8.html Thu Apr 24 19:41:13 2014
@@ -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>12.8 Creating complex form components with FormComponentPanel 6.x</title>
+ <title>12.8 File upload 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.8 Creating complex form components with FormComponentPanel - Reference Documentation</h1>
+ <h1>12.8 File upload - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,57 +159,45 @@ function addJsClass() {
-<h2 id="forms2_8">12.8 Creating complex form components with FormComponentPanel</h2>
-<p class="paragraph"/>In chapter 3.2.2 we have seen how to use class Panel to create custom components with their own markup and with an arbitrary number of children components.<p class="paragraph"/>While it's perfectly legal to use Panel also to group form components, the resulting component won't be itself a form component and it won't participate in the form's submission workflow.<p class="paragraph"/>This could be a strong limitation if the custom component needs to coordinate its children during sub-tasks like input conversion or model updating. That's why in Wicket we have the <code>org.apache.wicket.markup.html.form.FormComponentPanel</code> component which combines the features of a Panel (it has its own markup file) and a FormComponent (it is a subclass of FormComponent).<p class="paragraph"/>A typical scenario in which we may need to implement a custom FormComponentPanel is when our web application and its users work with different units of measurement for the same data.<p
class="paragraph"/>To illustrate this possible scenario, let's consider a form where a user can insert a temperature that will be recorded after being converted to Kelvin degrees (see the example project CustomForm ComponentPanel).<p class="paragraph"/>The Kelvin scale is wildly adopted among the scientific community and it is one of the seven base units of the <a href="http://en.wikipedia.org/wiki/International_System_of_Units" target="blank">International System of Units</a> , so it makes perfect sense to store temperatures expressed with this unit of measurement.<p class="paragraph"/>However, in our everyday life we still use other temperature scales like Celsius or Fahrenheit, so it would be nice to have a component which internally works with Kelvin degrees and automatically applies conversion between Kelvin temperature scale and the one adopted by the user.<p class="paragraph"/>In order to implement such a component, we can make a subclass of FormComponentPanel and leverage
the convertInput and onBeforeRender methods: in the implementation of the convertInput method we will convert input value to Kelvin degrees while in the implementation of onBeforeRender method we will take care of converting the Kelvin value to the temperature scale adopted by the user.<p class="paragraph"/>Our custom component will contain two children components: a text field to let user insert and edit a temperature value and a label to display the letter corresponding to user's temperature scale (F for Fahrenheit and C for Celsius). The resulting markup file is the following:<p class="paragraph"/><div class="code"><pre><html>
-<head>
-</head>
-<body>
- <wicket:panel>
- Registered temperature: <input size=<span class="java-quote">"3"</span> maxlength=<span class="java-quote">"3"</span>
- wicket:id=<span class="java-quote">"registeredTemperature"</span>/>
- <label wicket:id=<span class="java-quote">"mesuramentUnit"</span>></label>
- </wicket:panel>
-</body>
-</html></pre></div><p class="paragraph"/>As shown in the markup above FormComponentPanel uses the same <wicket:panel> tag used by Panel to define its markup. Now let's see the Java code of the new form component starting with the onInitialize() method:<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class TemperatureDegreeField <span class="java-keyword">extends</span> FormComponentPanel<<span class="java-object">Double</span>> {<p class="paragraph"/> <span class="java-keyword">private</span> TextField<<span class="java-object">Double</span>> userDegree;<p class="paragraph"/> <span class="java-keyword">public</span> TemperatureDegreeField(<span class="java-object">String</span> id) {
- <span class="java-keyword">super</span>(id);
- }<p class="paragraph"/> <span class="java-keyword">public</span> TemperatureDegreeField(<span class="java-object">String</span> id, IModel<<span class="java-object">Double</span>> model) {
- <span class="java-keyword">super</span>(id, model);
- }<p class="paragraph"/> @Override
- <span class="java-keyword">protected</span> void onInitialize() {
- <span class="java-keyword">super</span>.onInitialize();<p class="paragraph"/> AbstractReadOnlyModel<<span class="java-object">String</span>> labelModel=<span class="java-keyword">new</span> AbstractReadOnlyModel<<span class="java-object">String</span>>(){
- @Override
- <span class="java-keyword">public</span> <span class="java-object">String</span> getObject() {
- <span class="java-keyword">if</span>(getLocale().equals(Locale.US))
- <span class="java-keyword">return</span> <span class="java-quote">"°F"</span>;
- <span class="java-keyword">return</span> <span class="java-quote">"°C"</span>;
- }
- };<p class="paragraph"/> add(<span class="java-keyword">new</span> Label(<span class="java-quote">"mesuramentUnit"</span>, labelModel));
- add(userDegree=<span class="java-keyword">new</span> TextField<<span class="java-object">Double</span>>(<span class="java-quote">"registeredTemperature"</span>, <span class="java-keyword">new</span>
- Model<<span class="java-object">Double</span>>()));
- userDegree.setType(<span class="java-object">Double</span>.class);
- }</pre></div><p class="paragraph"/>Inside the onInitialize method we have created a read-only model for the label that displays the letter corresponding to the user's temperature scale. To determinate which temperature scale is in use, we retrieve the Locale from the session by calling Component's getLocale() method (we will talk more about this method in chapter 12). Then, if locale is the one corresponding to the United States, the chosen scale will be Fahrenheit, otherwise it will be considered as Celsius.<p class="paragraph"/>In the final part of onInitialize() we add the two components to our custom form component. You may have noticed that we have explicitly set the type of model object for the text field to double. This is necessary as the starting model object is a null reference and this prevents the component from automatically determining the type of its model object.<p class="paragraph"/>Now we can look at the rest of the code containing the convertInput and onBefo
reRender methods:<p class="paragraph"/><div class="code"><pre>// continued example
- @Override
- <span class="java-keyword">protected</span> void convertInput() {
- <span class="java-object">Double</span> userDegreeVal = userDegree.getConvertedInput();
- <span class="java-object">Double</span> kelvinDegree;<p class="paragraph"/> <span class="java-keyword">if</span>(getLocale().equals(Locale.US)){
- kelvinDegree = userDegreeVal + 459.67;
- BigDecimal bdKelvin = <span class="java-keyword">new</span> BigDecimal(kelvinDegree);
- BigDecimal fraction = <span class="java-keyword">new</span> BigDecimal(5).divide(<span class="java-keyword">new</span> BigDecimal(9));<p class="paragraph"/> kelvinDegree = bdKelvin.multiply(fraction).doubleValue();
- }<span class="java-keyword">else</span>{
- kelvinDegree = userDegreeVal + 273.15;
- }<p class="paragraph"/> setConvertedInput(kelvinDegree);
- }<p class="paragraph"/> @Override
- <span class="java-keyword">protected</span> void onBeforeRender() {
- <span class="java-keyword">super</span>.onBeforeRender();<p class="paragraph"/> <span class="java-object">Double</span> kelvinDegree = (<span class="java-object">Double</span>) getDefaultModelObject();
- <span class="java-object">Double</span> userDegreeVal = <span class="java-keyword">null</span>;<p class="paragraph"/> <span class="java-keyword">if</span>(kelvinDegree == <span class="java-keyword">null</span>) <span class="java-keyword">return</span>;<p class="paragraph"/> <span class="java-keyword">if</span>(getLocale().equals(Locale.US)){
- BigDecimal bdKelvin = <span class="java-keyword">new</span> BigDecimal(kelvinDegree);
- BigDecimal fraction = <span class="java-keyword">new</span> BigDecimal(9).divide(<span class="java-keyword">new</span> BigDecimal(5));<p class="paragraph"/> kelvinDegree = bdKelvin.multiply(fraction).doubleValue();
- userDegreeVal = kelvinDegree - 459.67;
- }<span class="java-keyword">else</span>{
- userDegreeVal = kelvinDegree - 273.15;
- }<p class="paragraph"/> userDegree.setModelObject(userDegreeVal);
- }
-}</pre></div><p class="paragraph"/>Since our component does not directly receive the user input, convertInput() must read this value from the inner text field using FormComponent's getConvertedInput() method which returns the input value already converted to the type specified for the component (Double in our case). Once we have the user input we convert it to kelvin degrees and we use the resulting value to set the converted input for our custom component (using method setConvertedInput(T convertedInput)).<p class="paragraph"/>Method onBeforeRender() is responsible for synchronizing the model of the inner textfield with the model of our custom component. To do this we retrieve the model object of the custom component with the getDefaultModelObject() method, then we convert it to the temperature scale adopted by the user and finally we use this value to set the model object of the text field.
+<h2 id="forms2_8">12.8 File upload</h2>
+<p class="paragraph"/>Wicket supports file uploading with the FileUploadField component which must be used with the <input> tag whose type attribute must be set to "file". In order to send a file on form submission we must enable multipart mode calling MultiPart(true)on our form.<p class="paragraph"/>In the next example (project UploadSingleFile) we will see a form which allows users to upload a file into the temporary directory of the server (path /tmp on Unix/Linux systems):<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><html>
+ <head>
+ </head>
+ <body>
+ <h1>Upload your file here!</h1>
+ <form wicket:id=<span class="java-quote">"form"</span>>
+ <input type=<span class="java-quote">"file"</span> wicket:id=<span class="java-quote">"fileUploadField"</span>/>
+ <input type=<span class="java-quote">"submit"</span> value=<span class="java-quote">"Upload"</span>/>
+ </form>
+ <div wicket:id=<span class="java-quote">"feedbackPanel"</span>>
+ </div>
+ </body>
+</html></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {
+ <span class="java-keyword">private</span> FileUploadField fileUploadField;<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
+ fileUploadField = <span class="java-keyword">new</span> FileUploadField(<span class="java-quote">"fileUploadField"</span>);<p class="paragraph"/> Form form = <span class="java-keyword">new</span> Form(<span class="java-quote">"form"</span>){
+ @Override
+ <span class="java-keyword">protected</span> void onSubmit() {
+ <span class="java-keyword">super</span>.onSubmit();<p class="paragraph"/> FileUpload fileUpload = fileUploadField.getFileUpload();<p class="paragraph"/> <span class="java-keyword">try</span> {
+ File file = <span class="java-keyword">new</span> File(<span class="java-object">System</span>.getProperty(<span class="java-quote">"java.io.tmpdir"</span>) + <span class="java-quote">"/"</span> +
+ fileUpload.getClientFileName());<p class="paragraph"/> fileUpload.writeTo(file);
+ } <span class="java-keyword">catch</span> (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ };<p class="paragraph"/> form.setMultiPart(<span class="java-keyword">true</span>);
+ //set a limit <span class="java-keyword">for</span> uploaded file's size
+ form.setMaxSize(Bytes.kilobytes(100));
+ form.add(fileUploadField);
+ add(<span class="java-keyword">new</span> FeedbackPanel(<span class="java-quote">"feedbackPanel"</span>));
+ add(form);
+ }
+}</pre></div><p class="paragraph"/>The code that copies the uploaded file to the temporary directory is inside the onSubmit method of the Form class. The uploaded file is handled with an instance of class FileUpload returned by the getFileUpload() method of the FileUploadField class. This class provides a set of methods to perform some common tasks like getting the name of the uploaded file (getClientFileName()), coping the file into a directory (writeTo(destinationFile)), calculating file digest (getDigest (digestAlgorithm)) and so on.<p class="paragraph"/>Form component can limit the size for uploaded files using its setMaxSize(size) method. In the example we have set this limit to 100 kb to prevent users from uploading files bigger than this size.<p class="paragraph"/><blockquote class="note">
+The maximum size for uploaded files can also be set at application's level using the setDefaultMaximumUploadSize(Bytes maxSize) method of the IApplicationSettings interface:<p class="paragraph"/><div class="code"><pre>@Override
+<span class="java-keyword">public</span> void init()
+{
+ getApplicationSettings().setDefaultMaximumUploadSize(Bytes.kilobytes(100));
+}</pre></div>
+</blockquote><p class="paragraph"/><h3>Upload multiple files</h3><p class="paragraph"/>If we need to upload multiple files at once, we can use the MultiFileUploadField component which allows the user to select an arbitrary number of files to send on form submission.<p class="paragraph"/>An example showing how to use this component can be found in Wicket module wicket-examples in file MultiUploadPage.java. The live example is hosted at <a href="http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi" target="blank">http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi</a> .
<div style="clear:both;margin-top:15px;"></div>
@@ -238,7 +226,7 @@ function addJsClass() {
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/forms2_9.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/forms2_9.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/forms2_9.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/forms2_9.html Thu Apr 24 19:41:13 2014
@@ -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>12.9 Stateless form 6.x</title>
+ <title>12.9 Creating complex form components with FormComponentPanel 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"/>
@@ -146,7 +146,7 @@ function addJsClass() {
<div class="project">
- <h1>12.9 Stateless form - Reference Documentation</h1>
+ <h1>12.9 Creating complex form components with FormComponentPanel - Reference Documentation</h1>
<p><strong>Authors:</strong> Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ</p>
@@ -159,49 +159,57 @@ function addJsClass() {
-<h2 id="forms2_9">12.9 Stateless form</h2>
-<p class="paragraph"/>In chapter 6 we have seen how Wicket pages can be divided into two categories: stateful and stateless. Pages that are stateless don't need to be stored in the user session and they should be used when we don't need to save any user data in the user session (for example in the public area of a site).<p class="paragraph"/>Besides saving resources on server-side, stateless pages can be adopted to improve user experience and to avoid security weaknesses. A typical situation where a stateless page can bring these benefits is when we have to implement a login page.<p class="paragraph"/>For this kind of page we might encounter two potential problems if we chose to use a stateful page. The first problem occurs when the user tries to login without a valid session assigned to him. This could happen if the user leaves the login page opened for a period of time bigger than the session's timeout and then he decides to log in. Under these conditions the user will be redirec
ted to a 'Page expired' error page, which is not exactly a nice thing for user experience.<p class="paragraph"/>The second problem occurs when a malicious user or a web crawler program attempts to login into our web application, generating a huge number of page versions and consequently increasing the size of the user session.<p class="paragraph"/>To avoid these kinds of problems we should build a stateless login page which does not depend on a user session. Wicket provides a special version of the Form component called StatelessForm which is stateless by default (i.e its method getStatelessHint() returns true), hence it's an ideal solution when we want to build a stateless page with a form. A possible implementation of our login form is the following (example project StatelessLoginForm):<p class="paragraph"/><strong class="bold">HTML:</strong><p class="paragraph"/><div class="code"><pre><html>
- <head>
- <meta charset=<span class="java-quote">"utf-8"</span> />
- </head>
- <body>
- <div>Session is <b wicket:id=<span class="java-quote">"sessionType"</span>></b></div>
- <br/>
- <div>Type 'user' as correct credentials</div>
- <form wicket:id=<span class="java-quote">"form"</span>>
- <fieldset>
- Username: <input type=<span class="java-quote">"text"</span> wicket:id=<span class="java-quote">"username"</span>/> <br/>
- Password: <input type=<span class="java-quote">"password"</span> wicket:id=<span class="java-quote">"password"</span>/><br/>
- <input type=<span class="java-quote">"submit"</span>/>
- </fieldset>
- </form>
- <br/>
- <div wicket:id=<span class="java-quote">"feedbackPanel"</span>></div>
- </body>
-</html></pre></div><p class="paragraph"/><strong class="bold">Java code:</strong><p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class HomePage <span class="java-keyword">extends</span> WebPage {
- <span class="java-keyword">private</span> Label sessionType;
- <span class="java-keyword">private</span> <span class="java-object">String</span> password;
- <span class="java-keyword">private</span> <span class="java-object">String</span> username;<p class="paragraph"/> <span class="java-keyword">public</span> HomePage(<span class="java-keyword">final</span> PageParameters parameters) {
- StatelessForm form = <span class="java-keyword">new</span> StatelessForm(<span class="java-quote">"form"</span>){
- @Override
- <span class="java-keyword">protected</span> void onSubmit() {
- //sign in <span class="java-keyword">if</span> username and password are âuserâ
- <span class="java-keyword">if</span>(<span class="java-quote">"user"</span>.equals(username) && username.equals(password))
- info(<span class="java-quote">"Username and password are correct!"</span>);
- <span class="java-keyword">else</span>
- error(<span class="java-quote">"Wrong username or password"</span>);
- }
- };<p class="paragraph"/> form.add(<span class="java-keyword">new</span> PasswordTextField(<span class="java-quote">"password"</span>));
- form.add(<span class="java-keyword">new</span> TextField(<span class="java-quote">"username"</span>));<p class="paragraph"/> add(form.setDefaultModel(<span class="java-keyword">new</span> CompoundPropertyModel(<span class="java-keyword">this</span>)));<p class="paragraph"/> add(sessionType = <span class="java-keyword">new</span> Label(<span class="java-quote">"sessionType"</span>, Model.of(<span class="java-quote">""</span>)));
- add(<span class="java-keyword">new</span> FeedbackPanel(<span class="java-quote">"feedbackPanel"</span>));
- }<p class="paragraph"/> @Override
- <span class="java-keyword">protected</span> void onBeforeRender() {
- <span class="java-keyword">super</span>.onBeforeRender();<p class="paragraph"/> <span class="java-keyword">if</span>(getSession().isTemporary())
- sessionType.setDefaultModelObject(<span class="java-quote">"temporary"</span>);
- <span class="java-keyword">else</span>
- sessionType.setDefaultModelObject(<span class="java-quote">"permanent"</span>);
- }
-}</pre></div><p class="paragraph"/>Label sessionType shows if current session is temporary or not and is set inside onBeforeRender(): if our page is really stateless the session will be always temporary. We have also inserted a feedback panel in the home page that shows if the credentials are correct. This was done to make the example form more interactive.
+<h2 id="forms2_9">12.9 Creating complex form components with FormComponentPanel</h2>
+<p class="paragraph"/>In chapter 3.2.2 we have seen how to use class Panel to create custom components with their own markup and with an arbitrary number of children components.<p class="paragraph"/>While it's perfectly legal to use Panel also to group form components, the resulting component won't be itself a form component and it won't participate in the form's submission workflow.<p class="paragraph"/>This could be a strong limitation if the custom component needs to coordinate its children during sub-tasks like input conversion or model updating. That's why in Wicket we have the <code>org.apache.wicket.markup.html.form.FormComponentPanel</code> component which combines the features of a Panel (it has its own markup file) and a FormComponent (it is a subclass of FormComponent).<p class="paragraph"/>A typical scenario in which we may need to implement a custom FormComponentPanel is when our web application and its users work with different units of measurement for the same data.<p
class="paragraph"/>To illustrate this possible scenario, let's consider a form where a user can insert a temperature that will be recorded after being converted to Kelvin degrees (see the example project CustomForm ComponentPanel).<p class="paragraph"/>The Kelvin scale is wildly adopted among the scientific community and it is one of the seven base units of the <a href="http://en.wikipedia.org/wiki/International_System_of_Units" target="blank">International System of Units</a> , so it makes perfect sense to store temperatures expressed with this unit of measurement.<p class="paragraph"/>However, in our everyday life we still use other temperature scales like Celsius or Fahrenheit, so it would be nice to have a component which internally works with Kelvin degrees and automatically applies conversion between Kelvin temperature scale and the one adopted by the user.<p class="paragraph"/>In order to implement such a component, we can make a subclass of FormComponentPanel and leverage
the convertInput and onBeforeRender methods: in the implementation of the convertInput method we will convert input value to Kelvin degrees while in the implementation of onBeforeRender method we will take care of converting the Kelvin value to the temperature scale adopted by the user.<p class="paragraph"/>Our custom component will contain two children components: a text field to let user insert and edit a temperature value and a label to display the letter corresponding to user's temperature scale (F for Fahrenheit and C for Celsius). The resulting markup file is the following:<p class="paragraph"/><div class="code"><pre><html>
+<head>
+</head>
+<body>
+ <wicket:panel>
+ Registered temperature: <input size=<span class="java-quote">"3"</span> maxlength=<span class="java-quote">"3"</span>
+ wicket:id=<span class="java-quote">"registeredTemperature"</span>/>
+ <label wicket:id=<span class="java-quote">"mesuramentUnit"</span>></label>
+ </wicket:panel>
+</body>
+</html></pre></div><p class="paragraph"/>As shown in the markup above FormComponentPanel uses the same <wicket:panel> tag used by Panel to define its markup. Now let's see the Java code of the new form component starting with the onInitialize() method:<p class="paragraph"/><div class="code"><pre><span class="java-keyword">public</span> class TemperatureDegreeField <span class="java-keyword">extends</span> FormComponentPanel<<span class="java-object">Double</span>> {<p class="paragraph"/> <span class="java-keyword">private</span> TextField<<span class="java-object">Double</span>> userDegree;<p class="paragraph"/> <span class="java-keyword">public</span> TemperatureDegreeField(<span class="java-object">String</span> id) {
+ <span class="java-keyword">super</span>(id);
+ }<p class="paragraph"/> <span class="java-keyword">public</span> TemperatureDegreeField(<span class="java-object">String</span> id, IModel<<span class="java-object">Double</span>> model) {
+ <span class="java-keyword">super</span>(id, model);
+ }<p class="paragraph"/> @Override
+ <span class="java-keyword">protected</span> void onInitialize() {
+ <span class="java-keyword">super</span>.onInitialize();<p class="paragraph"/> AbstractReadOnlyModel<<span class="java-object">String</span>> labelModel=<span class="java-keyword">new</span> AbstractReadOnlyModel<<span class="java-object">String</span>>(){
+ @Override
+ <span class="java-keyword">public</span> <span class="java-object">String</span> getObject() {
+ <span class="java-keyword">if</span>(getLocale().equals(Locale.US))
+ <span class="java-keyword">return</span> <span class="java-quote">"°F"</span>;
+ <span class="java-keyword">return</span> <span class="java-quote">"°C"</span>;
+ }
+ };<p class="paragraph"/> add(<span class="java-keyword">new</span> Label(<span class="java-quote">"mesuramentUnit"</span>, labelModel));
+ add(userDegree=<span class="java-keyword">new</span> TextField<<span class="java-object">Double</span>>(<span class="java-quote">"registeredTemperature"</span>, <span class="java-keyword">new</span>
+ Model<<span class="java-object">Double</span>>()));
+ userDegree.setType(<span class="java-object">Double</span>.class);
+ }</pre></div><p class="paragraph"/>Inside the onInitialize method we have created a read-only model for the label that displays the letter corresponding to the user's temperature scale. To determinate which temperature scale is in use, we retrieve the Locale from the session by calling Component's getLocale() method (we will talk more about this method in chapter 12). Then, if locale is the one corresponding to the United States, the chosen scale will be Fahrenheit, otherwise it will be considered as Celsius.<p class="paragraph"/>In the final part of onInitialize() we add the two components to our custom form component. You may have noticed that we have explicitly set the type of model object for the text field to double. This is necessary as the starting model object is a null reference and this prevents the component from automatically determining the type of its model object.<p class="paragraph"/>Now we can look at the rest of the code containing the convertInput and onBefo
reRender methods:<p class="paragraph"/><div class="code"><pre>// continued example
+ @Override
+ <span class="java-keyword">protected</span> void convertInput() {
+ <span class="java-object">Double</span> userDegreeVal = userDegree.getConvertedInput();
+ <span class="java-object">Double</span> kelvinDegree;<p class="paragraph"/> <span class="java-keyword">if</span>(getLocale().equals(Locale.US)){
+ kelvinDegree = userDegreeVal + 459.67;
+ BigDecimal bdKelvin = <span class="java-keyword">new</span> BigDecimal(kelvinDegree);
+ BigDecimal fraction = <span class="java-keyword">new</span> BigDecimal(5).divide(<span class="java-keyword">new</span> BigDecimal(9));<p class="paragraph"/> kelvinDegree = bdKelvin.multiply(fraction).doubleValue();
+ }<span class="java-keyword">else</span>{
+ kelvinDegree = userDegreeVal + 273.15;
+ }<p class="paragraph"/> setConvertedInput(kelvinDegree);
+ }<p class="paragraph"/> @Override
+ <span class="java-keyword">protected</span> void onBeforeRender() {
+ <span class="java-keyword">super</span>.onBeforeRender();<p class="paragraph"/> <span class="java-object">Double</span> kelvinDegree = (<span class="java-object">Double</span>) getDefaultModelObject();
+ <span class="java-object">Double</span> userDegreeVal = <span class="java-keyword">null</span>;<p class="paragraph"/> <span class="java-keyword">if</span>(kelvinDegree == <span class="java-keyword">null</span>) <span class="java-keyword">return</span>;<p class="paragraph"/> <span class="java-keyword">if</span>(getLocale().equals(Locale.US)){
+ BigDecimal bdKelvin = <span class="java-keyword">new</span> BigDecimal(kelvinDegree);
+ BigDecimal fraction = <span class="java-keyword">new</span> BigDecimal(9).divide(<span class="java-keyword">new</span> BigDecimal(5));<p class="paragraph"/> kelvinDegree = bdKelvin.multiply(fraction).doubleValue();
+ userDegreeVal = kelvinDegree - 459.67;
+ }<span class="java-keyword">else</span>{
+ userDegreeVal = kelvinDegree - 273.15;
+ }<p class="paragraph"/> userDegree.setModelObject(userDegreeVal);
+ }
+}</pre></div><p class="paragraph"/>Since our component does not directly receive the user input, convertInput() must read this value from the inner text field using FormComponent's getConvertedInput() method which returns the input value already converted to the type specified for the component (Double in our case). Once we have the user input we convert it to kelvin degrees and we use the resulting value to set the converted input for our custom component (using method setConvertedInput(T convertedInput)).<p class="paragraph"/>Method onBeforeRender() is responsible for synchronizing the model of the inner textfield with the model of our custom component. To do this we retrieve the model object of the custom component with the getDefaultModelObject() method, then we convert it to the temperature scale adopted by the user and finally we use this value to set the model object of the text field.
<div style="clear:both;margin-top:15px;"></div>
@@ -230,7 +238,7 @@ function addJsClass() {
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_1.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_1.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_1.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_1.html Thu Apr 24 19:41:13 2014
@@ -160,7 +160,8 @@ function addJsClass() {
<h2 id="helloWorld_1">4.1 Wicket distribution and modules</h2>
-Wicket is available as a binary package on the main site <a href="http://wicket.apache.org" target="blank">http://wicket.apache.org</a> . Inside this archive we can find the distribution jars of the framework. Each jar corresponds to a sub-module of the framework. The following table reports these modules along with a short description of their purpose and with the related dependencies:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Module'sname</strong></th><th><strong class="bold">Description</strong></th><th><strong class="bold">Dependencies</strong></th></tr><tr class="table-odd"><td>wicket-core</td><td>Contains the main classes of the framework, like class <code>Component</code> and <code>Application</code>.</td><td>wicket-request, wicket-util</td></tr><tr class="table-even"><td>wicket-request</td><td>This module contains the classes involved into web request processing.</td><td>wicket-util</td></tr><tr cla
ss="table-odd"><td>wicket-util</td><td>Contains general-purpose utility classes for functional areas such as I/O, lang, string manipulation, security, etc...</td><td>None</td></tr><tr class="table-even"><td>wicket-datetime</td><td>Contains special purpose components designed to work with date and time.</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-devutils</td><td>Contains utility classes and components to help developers with tasks such as debugging, class inspection and so on.</td><td>wicket-core, wicket-extensions</td></tr><tr class="table-even"><td>wicket-extensions</td><td>Contains a vast set of built-in components to build a rich UI for our web application (Ajax support is part of this module).</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-auth-roles</td><td>Provides support for role-based authorization.</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-ioc</td><td>This module provides common classes to support Inversion Of Control.
It's used by both Spring and Guice integration module.</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-guice</td><td>This module provides integration with the dependency injection framework developed by Google.</td><td>wicket-core, wicket-ioc</td></tr><tr class="table-even"><td>wicket-spring</td><td>This module provides integration with Spring framework.</td><td>wicket-core, wicket-ioc</td></tr><tr class="table-odd"><td>wicket-velocity</td><td>This module provides panels and utility class to integrate Wicket with Velocity template engine.</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-jmx</td><td>This module provides panels and utility class to integrate Wicket with Java Management Extensions.</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-objectsizeof-agent</td><td>Provides integration with Java agent libraries and instrumentation tools.</td><td>wicket-core</td></tr></table><p class="paragraph"/>Please note that the core module depends
on the utility and request modules, hence it cannot be used without them.
+Wicket is available as a binary package on the main site <a href="http://wicket.apache.org" target="blank">http://wicket.apache.org</a> . Inside this archive we can find the distribution jars of the framework. Each jar corresponds to a sub-module of the framework. The following table reports these modules along with a short description of their purpose and with the related dependencies:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Module'sname</strong></th><th><strong class="bold">Description</strong></th><th><strong class="bold">Dependencies</strong></th></tr><tr class="table-odd"><td>wicket-core</td><td>Contains the main classes of the framework, like class <code>Component</code> and <code>Application</code>.</td><td>wicket-request, wicket-util</td></tr><tr class="table-even"><td>wicket-request</td><td>This module contains the classes involved into web request processing.</td><td>wicket-util</td></tr><tr cla
ss="table-odd"><td>wicket-util</td><td>Contains general-purpose utility classes for functional areas such as I/O, lang, string manipulation, security, etc...</td><td>None</td></tr><tr class="table-even"><td>wicket-datetime</td><td>Contains special purpose components designed to work with date and time.</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-bean-validation</td><td>Provides support for JSR 303 standard validation.</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-devutils</td><td>Contains utility classes and components to help developers with tasks such as debugging, class inspection and so on.</td><td>wicket-core, wicket-extensions</td></tr><tr class="table-odd"><td>wicket-extensions</td><td>Contains a vast set of built-in components to build a rich UI for our web application (Ajax support is part of this module).</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-auth-roles</td><td>Provides support for role-based authorization.</td><t
d>wicket-core</td></tr><tr class="table-odd"><td>wicket-ioc</td><td>This module provides common classes to support Inversion Of Control. It's used by both Spring and Guice integration module.</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-guice</td><td>This module provides integration with the dependency injection framework developed by Google.</td><td>wicket-core, wicket-ioc</td></tr><tr class="table-odd"><td>wicket-spring</td><td>This module provides integration with Spring framework.</td><td>wicket-core, wicket-ioc</td></tr><tr class="table-even"><td>wicket-velocity</td><td>This module provides panels and utility class to integrate Wicket with Velocity template engine.</td><td>wicket-core</td></tr><tr class="table-odd"><td>wicket-jmx</td><td>This module provides panels and utility class to integrate Wicket with Java Management Extensions.</td><td>wicket-core</td></tr><tr class="table-even"><td>wicket-objectsizeof-agent</td><td>Provides integration with Java agent
libraries and instrumentation tools.</td><td>wicket-core</td></tr></table><p class="paragraph"/>Please note that the core module depends on the utility and request modules, hence it cannot be used without them.
+
<div style="clear:both;margin-top:15px;"></div>
@@ -189,7 +190,7 @@ Wicket is available as a binary package
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_2.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_2.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_2.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_2.html Thu Apr 24 19:41:13 2014
@@ -227,7 +227,7 @@ If we prefer to use a servlet instead of
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_3.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_3.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_3.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_3.html Thu Apr 24 19:41:13 2014
@@ -214,7 +214,7 @@ If we specify a <code>wicket:id</code> a
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_4.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_4.html Thu Apr 24 19:41:13 2014
@@ -217,7 +217,7 @@ We can specify the content of a link (i.
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_5.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_5.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_5.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/helloWorld_5.html Thu Apr 24 19:41:13 2014
@@ -191,7 +191,7 @@ In the last paragraph we had a first tas
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/i18n_1.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/i18n_1.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/i18n_1.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/i18n_1.html Thu Apr 24 19:41:13 2014
@@ -198,7 +198,7 @@ Providing a full description of Java sup
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/i18n_2.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/i18n_2.html?rev=1589849&r1=1589848&r2=1589849&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/i18n_2.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/i18n_2.html Thu Apr 24 19:41:13 2014
@@ -209,7 +209,7 @@ add(form.add(changeLocale))</pre></div><
<div id="footer">
Copyright © 2013-2014 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2014-04-10)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2014-04-24)</b>
</div>