You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

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.

Unknown macro: {div}

all forms enabled
outer form submitted

Outer

Middle

Inner

S

S

S

Unknown macro: {div}

all forms enabled
middle form submitted

Outer

Middle

Inner

_

S

S

Unknown macro: {div}

all forms enabled
inner form submitted

Outer

Middle

Inner

_

_

S

Unknown macro: {div}

middle form disabled
outer form submitted

Outer

Middle

Inner

S

_

_

Unknown macro: {div}

inner form disabled
outer form submitted

Outer

Middle

Inner

S

S

_

Unknown macro: {div}

outer form disabled
outer form submitted

Outer

Middle

Inner

_

_

_

Unknown macro: {div}

all forms enabled
middle form has error
outer form submitted

Outer

Middle

Inner

E

E

_

Unknown macro: {div}

all forms enabled
middle form has errors
middle form submitted

Outer

Middle

Inner

_

E

_

Unknown macro: {div}

all forms enabled
inner form has errors
middle form submitted

Outer

Middle

Inner

_

E

E

Unknown macro: {div}

middle form disabled
outer form has errors
outer form submitted

Outer

Middle

Inner

E

_

_

Unknown macro: {div}

all forms enabled
inner form has errors
outer form submitted

Outer

Middle

Inner

E

E

E

Unknown macro: {div}

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

Outer

Middle

Inner*

S

_

_

  • No labels