Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can display your own error messages using <code>error()</code> and <code>warn()</code> and <code>info()</code>. If you want to show errors dependent on validators or the required flag you can define a properties file with the same name as the class which contains a mapping of field -> message. For example:</p> <p><strong>Index.java</strong></p> <pre><code>Form form = new Form("myform"); form.add(new TextField("name").setRequired(true)); form.add(new PasswordTextField("password").setRequired(true)); form.add(new TextField("phonenumber").setRequired(true)); </code></pre> <p><strong>Index.properties</strong></p> <pre><code>Required=Provide a ${label} or else... </code></pre> <p>All required fields</p> <pre><code>myform.name.Required=You have to provide a name </code></pre> <p>The field <code>name</code> in the form <code>myform</code> when it is required.</p> <pre><code>password.Required=You have to provide a password </code></pre> <p>Any field with the name <code>password</code> when it is required.</p> <pre><code>phonenumber.Required=A telephone number is obligatory. </code></pre> <p>Any field with the name <code>phonenumber</code> when it is required.</p> <p>This shows a variety of ways of setting a feedback message for specific components.</p> <p>You can also put the properties files next to the following component level (in order of importance, top highest):</p> <ul> <li>Page Class</li> <li>Component Class</li> <li>Your Application Class</li> <li>Wickets Application Class</li> </ul> <p>Hope that helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload