Why on earth would you want to update a model value when there's a
validation error in the input? That is the whole point of validation!

Martijn

On Wed, Dec 10, 2008 at 10:44 AM, Rutger Jansen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a strange situation in the admin part of my application which I
> have reproduced in this tiny code example.
>
> In this example I can load a value in the textfield by clicking the
> link (which also increases the number to show that the link works ok).
> I can post the form without problems and load the value again.
> But when a validation error occurs (in this case when the posted value
> is too long), the field will not be updated after pressing the link
> (even though the log shows that the link is clicked), unless I post
> the form again without validation errors.
>
> Am I forgetting something here?
>
>
> Rutger
>
>
> --- Example page class---
> public class Example extends WebPage {
>
>  private String value;
>  private int valueVersion = 1;
>
>  public Example() {
>    Form form = new Form("form");
>
>    TextField textfield = new TextField("textfield", new
> PropertyModel(Example.this, "value"));
>    textfield.add(StringValidator.maximumLength(15));
>    form.add(textfield);
>
>    add(form);
>    add(new FeedbackPanel("feedback"));
>
>    add(new Link("link"){
>      @Override
>      public void onClick() {
>        value = "This is a test" + valueVersion++;
>      }
>    });
>  }
> }
>
> --- Example html ---
> <html xmlns="http://www.w3.org/1999/xhtml";
> xmlns:wicket="http://wicket.sourceforge.net/";>
> <head></head>
> <body>
>  <div wicket:id="feedback" />
>
>  <form wicket:id="form">
>    <input type="text" wicket:id="textfield"/>
>    <input type="submit" />
>  </form>
>
>  <p><a href="#" wicket:id="link">Load form value</a></p>
> </body>
> </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to