[ 
https://issues.apache.org/jira/browse/WICKET-6743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Helmut Lerch updated WICKET-6743:
---------------------------------
    Description: 
Hi,

not sure if it is an error, but do me it seems a strange behavior. It seems to 
me that after if there is a form in the a container the stream for 
streamChildren() stops.

Code StreamChildrenPage.java

{{public class StreamChildrenPage extends WebPage {}}{{public 
StreamChildrenPage() {}}
 WebMarkupContainer cont1 = new WebMarkupContainer("container1");
 cont1.add(new Label("label1", Model.of("Label 1")));
 Form<Void> form = new Form<Void>("form");
 cont1.add(form);
 form.add(new TextField<String>("text", Model.of("")));
 add(cont1);
 WebMarkupContainer cont2 = new WebMarkupContainer("container2");
 cont2.add(new Label("label2", Model.of("Label 2")));
 add(cont2);
 add(new Label("label3", Model.of("Label 3")));
}

@Override
 protected void onInitialize() {
  super.onInitialize();
  streamChildren().forEach(t -> {
 System.out.println(t.getClass() + " id: " + t.getId());
 });



{{}}}

Code StreamChildren.html:

{{<!DOCTYPE html>}}
 {{<html xmlns:wicket="http://wicket.apache.org";>}}
 {{<head>}}
 {{<meta charset="UTF-8">}}
 {{<meta name="viewport" content="width=device-width, initial-scale=1">}}
 {{</head>}}
 <body>
 <div wicket:id="container1">
  <div wicket:id="label1" ></div>
  <form wicket:id="form">
 <input wicket:id="text" />
 </form>
  </div>}}
 <div wicket:id="container2">
  <div wicket:id="label2" ></div>
  </div>
 <div wicket:id="label3" ></div
 </body>}}
 {{</html>}}

Output:

{{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
 {{class org.apache.wicket.markup.html.basic.Label id: label1}}
 {{class org.apache.wicket.markup.html.form.Form id: form}}
 {{class org.apache.wicket.markup.html.form.TextField id: text}}

If  form (and TextField) are not added in java (and removed from html) the 
following output is obtained:

{{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
 {{class org.apache.wicket.markup.html.basic.Label id: label1}}
 {{class org.apache.wicket.markup.html.WebMarkupContainer id: container2}}
 {{class org.apache.wicket.markup.html.basic.Label id: label2}}
 {{class org.apache.wicket.markup.html.basic.Label id: label3}}
 {{class org.apache.wicket.markup.html.internal.HtmlHeaderContainer id: 
_header_}}

Am I missing something?

Thanks,

Helmut

 

 

  was:
Hi,

not sure if it is an error, but do me it seems a strange behavior. It seems to 
me that after if there is a form in the a container the stream for 
streamChildren() stops.

Code StreamChildrenPage.java

{{public class StreamChildrenPage extends WebPage {}}{{public 
StreamChildrenPage() {}}
{{ WebMarkupContainer cont1 = new WebMarkupContainer("container1");}}
{{ cont1.add(new Label("label1", Model.of("Label 1")));}}
{{ Form<Void> form = new Form<Void>("form");}}
{{ cont1.add(form);}}
{{ form.add(new TextField<String>("text", Model.of("")));}}
{{ add(cont1);}}
{{ WebMarkupContainer cont2 = new WebMarkupContainer("container2");}}
{{ cont2.add(new Label("label2", Model.of("Label 2")));}}
{{ add(cont2);}}
{{ add(new Label("label3", Model.of("Label 3")));}}
{{ }}}

{{ @Override}}
{{ protected void onInitialize() {}}
{{ super.onInitialize();}}
{{ streamChildren().forEach(t -> {}}
{{ System.out.println(t.getClass() + " id: " + t.getId());}}
{{ });}}
{{ }}}

{{}}}

Code StreamChildren.html:

{{<!DOCTYPE html>}}
{{<html xmlns:wicket="http://wicket.apache.org";>}}
{{<head>}}
{{<meta charset="UTF-8">}}
{{<meta name="viewport" content="width=device-width, initial-scale=1">}}
{{</head>}}
{{ <body>}}
{{ <div wicket:id="container1">}}
{{ <div wicket:id="label1" ></div>}}
{{ <form wicket:id="form">}}
{{ <input wicket:id="text" />}}
{{ </form>}}
{{ </div>}}
{{ <div wicket:id="container2">}}
{{ <div wicket:id="label2" ></div>}}
{{ </div>}}
{{ <div wicket:id="label3" ></div>}}
{{ </body>}}
{{</html>}}

Output:

{{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
{{class org.apache.wicket.markup.html.basic.Label id: label1}}
{{class org.apache.wicket.markup.html.form.Form id: form}}
{{class org.apache.wicket.markup.html.form.TextField id: text}}

If  form (and TextField) are not added in java (and removed from html) the 
following output is obtained:

{{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
{{class org.apache.wicket.markup.html.basic.Label id: label1}}
{{class org.apache.wicket.markup.html.WebMarkupContainer id: container2}}
{{class org.apache.wicket.markup.html.basic.Label id: label2}}
{{class org.apache.wicket.markup.html.basic.Label id: label3}}
{{class org.apache.wicket.markup.html.internal.HtmlHeaderContainer id: 
_header_}}

Am I missing something?

Thanks,

Helmut

 

 


> MarkupContainer.streamChildren() not working with form?
> -------------------------------------------------------
>
>                 Key: WICKET-6743
>                 URL: https://issues.apache.org/jira/browse/WICKET-6743
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 8.6.1
>         Environment: Tomcat 8.5
>            Reporter: Helmut Lerch
>            Priority: Major
>
> Hi,
> not sure if it is an error, but do me it seems a strange behavior. It seems 
> to me that after if there is a form in the a container the stream for 
> streamChildren() stops.
> Code StreamChildrenPage.java
> {{public class StreamChildrenPage extends WebPage {}}{{public 
> StreamChildrenPage() {}}
>  WebMarkupContainer cont1 = new WebMarkupContainer("container1");
>  cont1.add(new Label("label1", Model.of("Label 1")));
>  Form<Void> form = new Form<Void>("form");
>  cont1.add(form);
>  form.add(new TextField<String>("text", Model.of("")));
>  add(cont1);
>  WebMarkupContainer cont2 = new WebMarkupContainer("container2");
>  cont2.add(new Label("label2", Model.of("Label 2")));
>  add(cont2);
>  add(new Label("label3", Model.of("Label 3")));
> }
> @Override
>  protected void onInitialize() {
>   super.onInitialize();
>   streamChildren().forEach(t -> {
>  System.out.println(t.getClass() + " id: " + t.getId());
>  });
> {{}}}
> Code StreamChildren.html:
> {{<!DOCTYPE html>}}
>  {{<html xmlns:wicket="http://wicket.apache.org";>}}
>  {{<head>}}
>  {{<meta charset="UTF-8">}}
>  {{<meta name="viewport" content="width=device-width, initial-scale=1">}}
>  {{</head>}}
>  <body>
>  <div wicket:id="container1">
>   <div wicket:id="label1" ></div>
>   <form wicket:id="form">
>  <input wicket:id="text" />
>  </form>
>   </div>}}
>  <div wicket:id="container2">
>   <div wicket:id="label2" ></div>
>   </div>
>  <div wicket:id="label3" ></div
>  </body>}}
>  {{</html>}}
> Output:
> {{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
>  {{class org.apache.wicket.markup.html.basic.Label id: label1}}
>  {{class org.apache.wicket.markup.html.form.Form id: form}}
>  {{class org.apache.wicket.markup.html.form.TextField id: text}}
> If  form (and TextField) are not added in java (and removed from html) the 
> following output is obtained:
> {{class org.apache.wicket.markup.html.WebMarkupContainer id: container1}}
>  {{class org.apache.wicket.markup.html.basic.Label id: label1}}
>  {{class org.apache.wicket.markup.html.WebMarkupContainer id: container2}}
>  {{class org.apache.wicket.markup.html.basic.Label id: label2}}
>  {{class org.apache.wicket.markup.html.basic.Label id: label3}}
>  {{class org.apache.wicket.markup.html.internal.HtmlHeaderContainer id: 
> _header_}}
> Am I missing something?
> Thanks,
> Helmut
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to