Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?
We're in the middle of migrating a large enterprise content management system (>1000 UI classes) from 6.x to 7.x. We've finally got it compiling with Wicket 7.x but we're having an issue with an EnclosureContainer that worked fine in Wicket 6.x. org.apache.wicket.WicketRuntimeException: Could not find child with id: menuTitle in the wicket:enclosure at org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.configure(Component.java:1056) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.internalBeforeRender(Component.java:941) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.beforeRender(Component.java:1018) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.onBeforeRender(Component.java:3921) ~[wicket-core-7.18.0.jar:7.18.0] at com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576) ~[classes/:?] ... I created a Wicket quickstart in 7.18.0 and was able to reproduce the issue with the following code: Markup: http://wicket.apache.org;> Apache Wicket Quickstart Apache Wicket Title Java: package com.sas; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.*; public class HomePage extends WebPage { private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { super(parameters); Label menuTitleLabel = new Label("menuTitle", "Fred"); EnclosureContainer ec = new EnclosureContainer("menuTitleEc", menuTitleLabel); ec.add(menuTitleLabel); menuTitleLabel.setVisible(true); add(ec); } } If I don't use an explicit EnclosureContainer and remove the wicket:id= from the wicket:enclosure element it works but I need to explicitly declare the enclosure in the component hierarchy. Regards, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?
I found a workaround (which may be the intended usage but the API docs don't seem very explicit in regard to EnclosureContainer) When using an EnclosureContainer don't use the wicket:enclosure tag like you do when not using an EnclosureContainer! Use some standard HTML e.g. div or span instead of wicket:enclosure: Title With the above markup the Wicket 6.x Java code works unchanged in Wicket 7.x On 12/09/2021 11:30 am, Chris Colman wrote: We're in the middle of migrating a large enterprise content management system (>1000 UI classes) from 6.x to 7.x. We've finally got it compiling with Wicket 7.x but we're having an issue with an EnclosureContainer that worked fine in Wicket 6.x. org.apache.wicket.WicketRuntimeException: Could not find child with id: menuTitle in the wicket:enclosure at org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.configure(Component.java:1056) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.internalBeforeRender(Component.java:941) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.beforeRender(Component.java:1018) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826) ~[wicket-core-7.18.0.jar:7.18.0] at org.apache.wicket.Component.onBeforeRender(Component.java:3921) ~[wicket-core-7.18.0.jar:7.18.0] at com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576) ~[classes/:?] ... I created a Wicket quickstart in 7.18.0 and was able to reproduce the issue with the following code: Markup: http://wicket.apache.org;> Apache Wicket Quickstart Apache Wicket Title Java: package com.sas; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.*; public class HomePage extends WebPage { private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { super(parameters); Label menuTitleLabel = new Label("menuTitle", "Fred"); EnclosureContainer ec = new EnclosureContainer("menuTitleEc", menuTitleLabel); ec.add(menuTitleLabel); menuTitleLabel.setVisible(true); add(ec); } } If I don't use an explicit EnclosureContainer and remove the wicket:id= from the wicket:enclosure element it works but I need to explicitly declare the enclosure in the component hierarchy. Regards, Chris - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?
On Sun, Sep 12, 2021, 08:03 Chris Colman wrote: > We're in the middle of migrating a large enterprise content management > system (>1000 UI classes) from 6.x to 7.x. > > We've finally got it compiling with Wicket 7.x but we're having an issue > with an EnclosureContainer that worked fine in Wicket 6.x. > > org.apache.wicket.WicketRuntimeException: Could not find child with id: > menuTitle in the wicket:enclosure > at > org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295) > > ~[wicket-core-7.18.0.jar:7.18.0] > at > org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273) > > ~[wicket-core-7.18.0.jar:7.18.0] > at > org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) > > ~[wicket-core-7.18.0.jar:7.18.0] > at > org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) > > ~[wicket-core-7.18.0.jar:7.18.0] > at org.apache.wicket.Component.configure(Component.java:1056) > ~[wicket-core-7.18.0.jar:7.18.0] > at > org.apache.wicket.Component.internalBeforeRender(Component.java:941) > ~[wicket-core-7.18.0.jar:7.18.0] > at org.apache.wicket.Component.beforeRender(Component.java:1018) > ~[wicket-core-7.18.0.jar:7.18.0] > at > org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826) > > ~[wicket-core-7.18.0.jar:7.18.0] > at org.apache.wicket.Component.onBeforeRender(Component.java:3921) > ~[wicket-core-7.18.0.jar:7.18.0] > at > com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576) > > ~[classes/:?] > ... > > > I created a Wicket quickstart in 7.18.0 and was able to reproduce the > issue with the following code: > > > Markup: > > > http://wicket.apache.org;> > > > Apache Wicket Quickstart > > > Apache Wicket > > You shouldn't use if you use EnclosureContainer. Use a instead. Title > > > > > Java: > > package com.sas; > > import org.apache.wicket.request.mapper.parameter.PageParameters; > import org.apache.wicket.markup.html.basic.Label; > import org.apache.wicket.markup.html.WebPage; > import org.apache.wicket.markup.html.basic.*; > > public class HomePage extends WebPage { > private static final long serialVersionUID = 1L; > > public HomePage(final PageParameters parameters) { > super(parameters); > > Label menuTitleLabel = new Label("menuTitle", "Fred"); > EnclosureContainer ec = new EnclosureContainer("menuTitleEc", > menuTitleLabel); > ec.add(menuTitleLabel); > menuTitleLabel.setVisible(true); > add(ec); > } > } > > > If I don't use an explicit EnclosureContainer and remove the wicket:id= > from the wicket:enclosure element it works but I need to explicitly > declare the enclosure in the component hierarchy. > > Regards, > Chris > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >