Get a specific Wicket Component within a Page
Asked Answered
O

1

7

What's the way to find a specific (known wicket id) Wicket Component within a Page regarding less effort performance?

Outfielder answered 20/3, 2013 at 13:53 Comment(4)
define best. define find.Jackass
define specific - what criteria must it match?Dialectology
best = less effort performance, find = get, and specific = known wicket idOutfielder
If 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()Dialectology
D
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 another ComponentHierachyIterator with the filtered component(s).
Dialectology answered 20/3, 2013 at 18:28 Comment(2)
Links are broken.Bisitun
The ComponentHierachyIterator is deprecated.Grandfatherly

© 2022 - 2024 — McMap. All rights reserved.