This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Nested Forms
Skip to end of metadata
Go to start of metadata

This page should serve as a "specification" (aka nominal state, not the current state) on nested form handling.
Please review the various situations and correct any mistakes or add new situations if necessary.
Thanks, Gerolf

The Conditional Validation page contains some practical examples regarding nested forms and validation.

It might be a good idea to use input instead of button elements in your form hierarchy. IE tends to send all button values, making it difficult to establish the one used to submit.

Markup
<form wicket:id="outer">
  <form wicket:id="middle">
    <form wicket:id="inner">
    </form>
  </form>
</form>
Legend

form...enabled
form...disabled

form...submitted form with no errors
form...form with errors

E...onError called
S...onSubmit called
_...nothing called, but input is preserved

Notice

When submitting a nested form, the entire <form> is submitted (including fileuploads), but processed according to the rules below.

all forms enabled
outer form submitted

Outer

Middle

Inner

S

S

S

all forms enabled
middle form submitted

Outer

Middle

Inner

_

S

S

all forms enabled
inner form submitted

Outer

Middle

Inner

_

_

S

middle form disabled
outer form submitted

Outer

Middle

Inner

S

_

_

inner form disabled
outer form submitted

Outer

Middle

Inner

S

S

_

outer form disabled
outer form submitted

Outer

Middle

Inner

_

_

_

all forms enabled
middle form has error
outer form submitted

Outer

Middle

Inner

E

E

_

all forms enabled
middle form has errors
middle form submitted

Outer

Middle

Inner

_

E

_

all forms enabled
inner form has errors
middle form submitted

Outer

Middle

Inner

_

E

E

middle form disabled
outer form has errors
outer form submitted

Outer

Middle

Inner

E

_

_

all forms enabled
inner form has errors
outer form submitted

Outer

Middle

Inner

E

E

E

middle form disabled
inner form has (*potential) errors
outer form submitted

Outer

Middle

Inner*

S

_

_

  • No labels