[
https://issues.apache.org/jira/browse/WICKET-1815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12725871#action_12725871
]
Russell Morrisey edited comment on WICKET-1815 at 6/30/09 5:50 PM:
-------------------------------------------------------------------
I am also experiencing an issue in my current project where I get nested <form>
tags when overriding Form#isVisible() and using
form.setOutputMarkupPlaceholderTag(true). In my case, it was causing input
entered by the user to be lost when the outer form was submitted.
When the inner form is initially hidden, and I use AJAX behavior to un-hide the
form (targeting the markup placeholder in the original output) after the page
is loaded, it causes strange behavior in IE 6 - components in the form that are
lower on the page, after the inner form, are ommitted from the request when the
outer form is submitted. The markup placeholder within the outer form looks
like:
<form
action="../../../../../?wicket:interface=:3:contentPanel:dataForm:2:IFormSubmitListener::"
wicket:id="dataForm" method="post" id="dataForm33">
...<form id="phaseTaskFormf6" style="display:none"></form>...
</form>
Like German, I pushed the isVisible implementation up to a wrapper containing
the inner Form and this solved the issue.
was (Author: rmorrisey):
I am also experiencing an issue in my current project where I get nested
<form> tags when overriding Form#isVisible(). In my case, it was causing input
entered by the user to be lost when the outer form was submitted.
When the inner form is initially hidden, and I use AJAX behavior to un-hide the
form (targeting the markup placeholder in the original output) after the page
is loaded, it causes strange behavior in IE 6 - components in the form that are
lower on the page, after the inner form, are ommitted from the request when the
outer form is submitted. The markup placeholder within the outer form looks
like:
<form
action="../../../../../?wicket:interface=:3:contentPanel:dataForm:2:IFormSubmitListener::"
wicket:id="dataForm" method="post" id="dataForm33">
...<form id="phaseTaskFormf6" style="display:none"></form>...
</form>
Like German, I pushed the isVisible implementation up to a wrapper containing
the inner Form and this solved the issue.
> Problem rendering not visible Form with OutputMarkupPlaceholderTag
> ------------------------------------------------------------------
>
> Key: WICKET-1815
> URL: https://issues.apache.org/jira/browse/WICKET-1815
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.3
> Environment: Nothing special, i guess.
> Reporter: German Morales
> Assignee: Matej Knopp
> Priority: Minor
>
> Hi all,
> We had suffered an strange behavior, which i would like to share for comments.
> We have a Panel (loaded with ajax) with many Forms inside (because each needs
> different models).
> Some of these Forms are only visible under certain conditions, so we
> overwrote isVisible with the condition.
> Also, the Panel can be updated, so the Forms have
> setOutputMarkupPlaceholderTag(true) to make them visible later.
> That triggered a problem in the rendering of the ajax response.
> After some investigation, the problem seems to be:
> -When a Form is visible, Form#onComponentTag replaces the tag "form" by "div"
> (because it's nor the Root form of the page), this works ok.
> -When a Form is invisible, Form#onComponentTag is never called. Instead,
> Component#render builds the response by itself, using
> markupStream.getTag().getName(), which answers the tag "form".
> -Then, the ajax response has a mix of "div" and "form". Apparently, all goes
> ok until the first "form" is found, then the parsing goes somehow crazy and
> this first "form" gets lost from the DOM, and the next forms and divs get
> inserted outside (one level in DOM) the main component being replaced by the
> ajax call.
> We have found no way to fix it in the Form class itself. Component uses
> markupStream.getTag() (which answers "form"). That is, it does not ask the
> component for the tag to answer, but instead trusts in the HTML side. And we
> can't change our html to say "div", because Form also checks (when visible)
> that the tag says "form" (checkComponentTag(tag, "form")).
> The solution was to put the missbehaving forms inside Panels, which do not
> suffer this problem, and then make the panels visible/invisible (also with
> OutputMarkupPlaceholderTag).
> We have it running now, but we wanted to know if there was some better
> solution, or perpahs something should be fixed to prevent future problems,
> for example:
> -inform somehow if a form is being set as invisible with
> setOutputMarkupPlaceholderTag(true)?
> -let Component ask itself for the tag to output in case of invisible +
> setOutputMarkupPlaceholderTag(true), instead of just putting what the markup
> says... then Form could say "no, i want a div here".
> -other?
> Thanks in advance,
> German
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.