-1
<div class="scroll" ui:field="mainContainer">
<ul ui:field="liContainer">
</ul>
</div>
代碼:
LIElement li = Document.get().createLIElement();
AnchorElement a = Document.get().createAnchorElement();
a.setAttribute("href", "#");
li.appendChild(a);
Image img = new Image(fsd.getImgUrl());
img.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Hello, again");
}
});
SpanElement span = Document.get().createSpanElement();
span.setInnerText(fsd.getName());
a.appendChild(img.getElement());
a.appendChild(span);
liContainer.appendChild(li);
注:
@UiField
UListElement liContainer;
如果您想要某人感興趣,您需要在提問時做出努力!我認爲你誤解了stackoverflow的策略。 – enguerran 2011-03-28 13:25:35