I think the Form or even the Component needs another property to make visible the hierarchy mismatch between Wicket components and its HTML. The problem is that the modal window components has its markup on top of the markup hierarchy, but the same is not true for the component hierarchy. Some time ago, I coded in the progress bar some test like: if getParent(ModalWindow) != null do ... This is horrible (the progress bar can't be move out from wicket-extensions for now), but I couldn't figure out at the time a better way of detect the hierarchy mismatch and respond appropriately (there was an bug going on). If the component had this property, ModalWindow would had it set to true, Form would test its parents to see if there is an mismatch, and decide to output an form or an div tag.
Pros - user can decide to have or not an nested form inside the modal window - currently it is mandatory to be nested, root forms inside the modal window output invalid markup - progress bar can stop depend on being in the same project as ModalWindow - easy to create custom components that behave like the modal window ---------- Forwarded message ---------- From: Martin Grigorov (JIRA) <[email protected]> Date: Mon, Feb 14, 2011 at 5:52 PM Subject: [jira] Commented: (WICKET-3424) Modal with a fragment containing 2 forms, 2nd form doesn't properly submit. To: [email protected] [ https://issues.apache.org/jira/browse/WICKET-3424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994453#comment-12994453] Martin Grigorov commented on WICKET-3424: ----------------------------------------- The issue is easily reproducible. I think range.createContextualFragment() doesn't create the <form> because there is another form that wraps the fragment (the modal window's form) and since nesting of forms is not allowed by spec this method doesn't create the new one. I have no idea how to resolve it for now. There are several other tickets about removing the modal window's form but this is a tough component, who knows what will break when touch it. > Modal with a fragment containing 2 forms, 2nd form doesn't properly submit. > --------------------------------------------------------------------------- > > Key: WICKET-3424 > URL: https://issues.apache.org/jira/browse/WICKET-3424 > Project: Wicket > Issue Type: Bug > Components: wicket-extensions > Affects Versions: 1.4.15 > Environment: Windows xp pro, java 1.6 > Reporter: Nathan Collette > Labels: form, modal, multiple > Attachments: multipleFormsInModal.zip > > > Click a link that opens a modal window with a fragment containing 2 forms. The forms visibility is switched on or off. An error is given when the second form is made visible and a submit is made on it. "Trying to submit for with id <id> that is not in document" -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira -- Pedro Henrique Oliveira dos Santos
