0
在java類中,我需要向wicket中的Label添加列表(例如list.getFirstName()),並且第一個名稱是html中的超鏈接。下面我有Java和HTML html代碼的代碼如何在wickets中添加鏈接
<tr >
<a wicket:id="gotoClass">
<span wicket:id="firstname"></span>
</a>
</tr>
的Java類
Iterator<String> brds = list.iterator();
RepeatingView repeating = new RepeatingView("repeating");
add(repeating);
while (brds.hasNext())
{
AbstractItem item = new AbstractItem(repeating.newChildId());
repeating.add(item);
String contact = brds.next();
item.add(new Label("firstname", contact));
}
上面的代碼對我的作品和我能夠添加標籤,也就是說,如果我有10個名字在列表中,我能夠在html.But添加10個標籤,我嘗試添加在HTML錨標記和
form.add(new BookmarkablePageLink<String>("firstname", gotoClass.class));
在Java
然後我得到以下異常
最後一個原因:無法在[[Component id = formname]]中找到ID爲'firstname'的組件 預期:'formname.firstname'。 具有類似名稱的發現:「」
任何人可以幫助我這個
問候 沙拉斯