Description
In the JavaDoc of MarkupContainer, the following is not correct:
--------------------------
...Children can be added by calling the add() method, and they can be looked up using a dotted path. For example, if a container called "a" held a nested container "b" which held a nested component "c", then a.get("b.c") would return the Component with id "c". ...
------------------
In the code of MarkupContainer, we use Component.PATH_SEPARATOR, which is ":". The example in JavaDoc should be updated to
use a.get("b:c") rather than a.get("b.c").
-------------------------------------------------------------
/**
- Get a child component by looking it up with the given path.
- @param path
- Path to component
- @return The component at the path
*/
public final Component get(final String path)
{
// Reference to this container
if (path == null || path.trim().equals("")) { return this; }
// Get child's id, if any
final String id = Strings.firstPathComponent(path, Component.PATH_SEPARATOR);
// Get child by id
Component child = children_get(id);
// If the container is transparent, than ask its parent.
// ParentResolver does something quite similar, but because of <head>,
// <body>, <wicket:panel> etc. it is quite common to have transparent
// components. Hence, this is little short cut for a tiny performance
// optimization.
if ((child == null) && isTransparentResolver() && (getParent() != null))
// Found child?
if (child != null)
return child;
}
--------------------------------------------------------------