Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5-RC1
    • Fix Version/s: None
    • Component/s: wicket-extensions
    • Labels:
      None

      Description

      Currently ModalWindow's javascript generates a generic <form> tag into the page.
      This is done to support nested forms while preventing temporary invalid HTML markup in the browser, i.e. a form nested in a another form.

      IMHO this is rather inelegant, which manifests itself in the following note in ModalWindow's javadoc:
      "If you want to use form in modal window component make sure that you put the modal window itself in another form (nesting forms is legal in Wicket) ..."
      I'm always having a hard time to explain this sentence to Wicket newcomers.

      My proposal: Let go of the <form> tag in javascript with the attached patch!

      The changed code now adds ModalWindow's markup first into the HTML page and then replaces its content directly with the component's markup to show in the modal window (the current implementation does it the other way around).

      The proposed change would require a migration effort for some usages of ModalWindow though. Forms inside a ModalWindow inside another form have to be 'made root forms', either by overriding isRootForm() and getRootForm() or perhaps we could introduce a new interface (e.g. IFormSeparator) which signals to a form that its containment in another form doesn't make it a nested form.

      Note that this issue is not about esthetics only, we have reocurring usecases in our projects (a form inside a modal window inside another multipart form) which require quirks to make it work. I can provide more information on this if required.

      Further note that even standard form submits are now possible on ModalWindows too (might be interesting for multipart uploads directly initiated from a ModalWindow's form).

      1. ModalWindow.patch
        7 kB
        Sven Meier
      2. ModalWindow_v2.patch
        7 kB
        Sven Meier

        Issue Links

          Activity

          Sven Meier created issue -
          Sven Meier made changes -
          Field Original Value New Value
          Attachment ModalWindow.patch [ 12469687 ]
          Frank Klein Koerkamp made changes -
          Link This issue is related to WICKET-3146 [ WICKET-3146 ]
          Sven Meier made changes -
          Attachment ModalWindow_v2.patch [ 12471320 ]
          Igor Vaynberg made changes -
          Fix Version/s 1.6.0 [ 12315431 ]
          Sven Meier made changes -
          Link This issue is related to WICKET-3424 [ WICKET-3424 ]
          Sven Meier made changes -
          Assignee Sven Meier [ svenmeier ]
          Sven Meier made changes -
          Link This issue blocks WICKET-4423 [ WICKET-4423 ]
          Martin Grigorov made changes -
          Fix Version/s 6.0.0-RC1 [ 12320343 ]
          Fix Version/s 6.0.0-beta1 [ 12315431 ]
          Martin Grigorov made changes -
          Fix Version/s 6.0.0-beta2 [ 12320343 ]
          Gavin made changes -
          Link This issue blocks WICKET-4423 [ WICKET-4423 ]
          Gavin made changes -
          Link This issue is depended upon by WICKET-4423 [ WICKET-4423 ]

            People

            • Assignee:
              Sven Meier
              Reporter:
              Sven Meier
            • Votes:
              7 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development