|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.markup.resolver.ScopedComponentResolver
public class ScopedComponentResolver
Implement a component resolver which walks up the component tree until a Page or Panel and tries to find a component with a matching wicket id, effectivly providing something like scoping for wicket id resolution.
Note: This resolver is not activated by default. It has to be added by means of
Application.getComponentResolvers().add(new InheritComponentResolver())
to be activated..
Example:
MyPage()
{
add(new Label("hidden-by-cont1","hidden"));
add(new Label("global","can be everywhere")); //the intresting 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: Prints: hiddenSo 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.Prints: cont1 hides Prints: cont1 same-idPrints: can be everywhere Prints: cont2 same-id
MarkupContainer.isTransparentResolver(),
ParentResolver,
Serialized Form| Constructor Summary | |
|---|---|
ScopedComponentResolver()
Construct. |
|
| Method Summary | |
|---|---|
boolean |
resolve(MarkupContainer container,
MarkupStream markupStream,
ComponentTag tag)
Try to resolve the tag, then create a component, add it to the container and render it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScopedComponentResolver()
| Method Detail |
|---|
public boolean resolve(MarkupContainer container,
MarkupStream markupStream,
ComponentTag tag)
IComponentResolver
resolve in interface IComponentResolvercontainer - The container parsing its markupmarkupStream - The current markupStreamtag - The current component tag while parsing the markup
IComponentResolver.resolve(wicket.MarkupContainer,
wicket.markup.MarkupStream, wicket.markup.ComponentTag)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||