Wicket
  1. Wicket
  2. WICKET-5076

form#onSubmit() is called on just replaced nested forms

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.6, 6.6.0
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket-extensions
    • Labels:
      None
    • Environment:
      Linux debian unstable 64-bit
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

      Description

      I use wizard api from wicket extensions.
      Next button is implemented like org.apache.wicket.extensions.wizard.NextButton.
      It means: if step is complete wizardModel.next() is called and step content is replaced.

      I send you example - see attachment.

      In the example Step2Panel contains inner form "innerForm".
      The problem is when we leave step 1 (click to next button) - innerForm.onSubmit from step 2 is called.
      Obversely when we leave step 2 innerForm.onSubmit is not called!

      One solution is to call form.process(null) manually in Nextbutton.onClick before step content is replaced. It is wrong again becaouse innerForm.onSubmit is called twice.

        Activity

        Hide
        Ondrej Fafejta added a comment -
        Show
        Ondrej Fafejta added a comment - Example is available on https://github.com/fafejtao/wicketWizardInnerFormBug
        Hide
        Sven Meier added a comment -

        forms are now collected before delegating to the form submitter

        Show
        Sven Meier added a comment - forms are now collected before delegating to the form submitter

          People

          • Assignee:
            Sven Meier
            Reporter:
            Ondrej Fafejta
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development