【发布时间】:2015-02-05 06:15:31
【问题描述】:
我尝试在带有检票口的简单表格中添加图像。我在谷歌搜索,但我不明白答案。目前,我只有单元格中图像的路径。
page.html
<table id="table51">
<tr>
<th id="th51"><span wicket:id="chap51t1"></span></th>
<th id="th51"><span wicket:id="chap51t2"></span></th>
<th id="th51"><span wicket:id="chap51t3"></span></th>
<th id="th51"><span wicket:id="chap51t4"></span></th>
</tr>
<tr wicket:id="perso">
<td id="td51" wicket:id="perso_nom"></td>
<td id="td51" wicket:id="perso_image"></td>
<td id="td51" wicket:id="perso_description"></td>
<td id="td51" wicket:id="perso_type"></td>
</tr>
</table>
page.java
List<Table51Bean> tableperso = new ArrayList<Table51Bean>();
tableperso.add(new Table51Bean(getString("chap51p1n"), getString("chap51p1i"), getString("chap51p1d"), getString("chap51p1t")));
tableperso.add(new Table51Bean(getString("chap51p2n"), getString("chap51p2i"), getString("chap51p2d"), getString("chap51p2t")));
ListView<Table51Bean> perso = new ListView<Table51Bean>("perso", tableperso) {
@Override
protected void populateItem(final ListItem<Table51Bean> item) {
// Retrieve the current Locale
final Table51Bean loc = item.getModelObject();
// Add a Label for the nom
item.add(new Label("perso_nom", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return loc.getNom();
}
}));
// Add a Label for the image
item.add(new Label("perso_image", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return loc.getImage();
}
}));
// Add a Label for the description
item.add(new Label("perso_description", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return loc.getDescription();
}
}));
// Add a Label for the type
item.add(new Label("perso_type", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return loc.getType();
}
}));
}
};
divchap51.add(perso);
我想知道是否可以在此代码中集成图像?
【问题讨论】:
标签: java html image html-table wicket