nteresting case WebMarkupContainer cont1 = new WebMarkupContainer("cont1"); add(cont1); cont1.add(new Label("hidden-by-cont1", "cont1 hides")); cont1.add(new Label("same-id", "cont1 same-id")); WebMarkupContainer cont2 = new WebMarkupContainer("cont2"); add(cont2); cont2.add(new Label("same-id", "cont2 same-id")); }
HTML: <html> <body> <span wicket:id="hidden-by-cont1">Prints: hidden</span> <div wicket:id="cont1"> <span wicket:id="hidden-by-cont1">Prints: cont1 hides</span> <span wicket:id="same-id">Prints: cont1 same-id</span> </div> <div wicket:id="cont2"> <span wicket:id="global">Prints: can be everywhere</span> <span wicket:id="same-id">Prints: cont2 same-id</span> </div>
So you can use the same ids in the same page. If the containing containers are not in the same hierarchy-line nothing changes. A comp with the same id hides the one of the parent-container with the same id.
@see org.apache.wicket.MarkupContainer#isTransparentResolver()
@see org.apache.wicket.markup.resolver.ParentResolver
@author Christian Essl
@author Juergen Donnerstag