使用 PageView 来调试页面.
Wicket中提供了一个PageView类,顾名思义 就是查看当前page的信息, 使用该类可以显示当前页面的所有组件.
使用方法很简单在page中加上一个markup: <span wicket:id="componentTree"/>
然后 添加一下代码到page的构造函数中.
add(new PageView("componentTree", this));
对于 Wicket教程2 的输出信息如下:
[Page class = wicket.quickstart.Index, id = 2]:
#
Path
Size
Type
Model Object
1
_
423 bytes
wicket.markup.html.internal.HtmlBodyContainer
2
border
980 bytes
wicket.quickstart.MyBorder
3
border:label
458 bytes
wicket.markup.html.basic.Label
This is a label.
4
border:label2
465 bytes
wicket.markup.html.basic.Label
This is another label.
5
boxBorder
1.2K
wicket.markup.html.border.BoxBorder
6
boxBorder:inBoxBorder
468 bytes
wicket.markup.html.basic.Label
This is a Box Border
7
boxBorder:multiLineLabel2InBoxBorder
645 bytes
wicket.markup.html.basic.MultiLineLabel
MultiLineLabel shows text that spans multiple lines by inserting line breaks (BR tags) for newlines and paragraph markers (P tags) for sequences of more than one newline.
8
multiLineLabel
633 bytes
wicket.markup.html.basic.MultiLineLabel
MultiLineLabel shows text that spans multiple lines by inserting line breaks (BR tags) for newlines and paragraph markers (P tags) for sequences of more than one newline.
9
name
N/A
wicket.markup.html.basic.Label
Icess
10
test
454 bytes
wicket.markup.html.basic.Label
Hello World!