Hi Martin,

You are right, the commit message could have used a bit more
explanation. As you can see at Github, the change was intentional.
Unfortunately there seems to be no testcase covering this piece of
code, but IMHO it was broken and is fixed now. From what I can see,
the only difference between the method in Form and in Component should
be that the tag name must be changed to div when the form is nested.
The check for getOutputMarkupId is bogus, a placeholder always has a
markup id. The code for getAjaxRegionMarkupId seemed appropriate. The
code was also missing the data attribute. I assumed we simply forgot
to keep this method up to date while we changed its
super-implementation. Please correct me if I'm wrong.

Emond

On Wed, Jan 29, 2020 at 9:12 AM Martin Grigorov <mgrigo...@apache.org> wrote:
>
> On Tue, Jan 28, 2020 at 10:19 PM <papega...@apache.org> wrote:
>
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > papegaaij pushed a commit to branch csp
> > in repository https://gitbox.apache.org/repos/asf/wicket.git
> >
> >
> > The following commit(s) were added to refs/heads/csp by this push:
> >      new fb290e8  WICKET-6725: fixed special Form placeholder rendering
> > fb290e8 is described below
> >
> > commit fb290e818a278eb69f4fa64d77514d8f3ee3068c
> > Author: Emond Papegaaij <emond.papega...@topicus.nl>
> > AuthorDate: Tue Jan 28 21:18:50 2020 +0100
> >
> >     WICKET-6725: fixed special Form placeholder rendering
> > ---
> >  .../main/java/org/apache/wicket/markup/html/form/Form.java    | 11
> > +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> >
> > diff --git
> > a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
> > b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
> > index a39160a..2ffc52b 100644
> > ---
> > a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
> > +++
> > b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
> > @@ -1698,14 +1698,9 @@ public class Form<T> extends WebMarkupContainer
> >                 else
> >                 {
> >                         // rewrite inner form tag as div
> > -                       response.write("<div style=\"display:none\"");
> > -                       if (getOutputMarkupId())
> > -                       {
> > -                               response.write(" id=\"");
> > -                               response.write(getMarkupId());
> > -                               response.write("\"");
> > -                       }
> > -                       response.write("></div>");
> > +                       response.write(
> > +                               String.format("<div id=\"%s\" class=\"%s\"
> > data-wicket-placeholder=\"\"></div>",
> > +                                       getAjaxRegionMarkupId(),
> > getString(CssUtils.key(Component.class, "hidden"))));
> >
>
> Why did you replace the usage of getOutputMarkupId()+getMarkupId()
> with getAjaxRegionMarkupId() ?
> Please use better commit messages! It is not clear whether you wanted to
> actually make this change or broke it unintentionally.
>
>
> >                 }
> >         }
> >
> >
> >

Reply via email to