What's the way to find a specific (known wicket id) Wicket Component within a Page regarding less effort performance?
Asked
Active
Viewed 1.1k times
7
-
define best. define find. – tetsuo Mar 20 '13 at 16:58
-
define specific - what criteria must it match? – Robert Niestroj Mar 20 '13 at 17:45
-
best = less effort performance, find = get, and specific = known wicket id – cobeete Mar 20 '13 at 22:00
-
4If you know the whole path to the component then for sure use the `get()` method from my answer. Otherwise you have to go with `visitChildren()` – Robert Niestroj Mar 20 '13 at 22:11
1 Answers
14
Your options are:
- The get() method of the component which searches for a component at a specific path.
- An iterator() on the MarkupContainer which has all his children.
- Use the visitChildren() that has all children and grandchildren of a
MarkupContainer.
visitChildren()
returns ComponentHierachyIterator which in turn has a method which has a method filterById() that returns anotherComponentHierachyIterator
with the filtered component(s).

zagrimsan
- 195
- 2
- 14

Robert Niestroj
- 15,299
- 14
- 76
- 119