bert
bert

Reputation: 7696

Wicket: Loosing form input on page re-render

I have pages with forms. Everything is working fine. Except, that there is a link (language selecter) on the pages. The requirement is, that when the user has already input in the form fields and than (without submitting the form) is clicking the link, all input should be retained.

If the link would be part of the form, this could easily archived via a SubmitLink and submitLink.setDefaultFormProcessing(false);

Unfortunately, this link has no knowledge of the form(s) on this page.

Any pointers if this is solvable? Of course, validation should not be triggered.

Upvotes: 0

Views: 150

Answers (1)

svenmeier
svenmeier

Reputation: 5681

  1. client-side JavaScript solution
  2. wrap complete page content in a form (yes, Wicket allows nesting of forms) and use an SubmitLink with defaultFormProcessing=false
  3. add an AjaxFormComponentUpdatingBehavior to all your form fields, so the input is always sent to the server

Upvotes: 2

Related Questions