Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a specific Wicket Component within a Page

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

like image 834
cobeete Avatar asked Mar 20 '13 13:03

cobeete


1 Answers

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).
like image 93
Robert Niestroj Avatar answered Oct 15 '22 23:10

Robert Niestroj