final HTML link = new HTML("<a href='javascript:;'>" + contact.name
+ "</a>");
panel.add(link);
// Add a click listener that displays a ContactPopup when it is clicked.
link.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
ContactPopup popup = new ContactPopup(contact);
int left = link.getAbsoluteLeft() + 14;
int top = link.getAbsoluteTop() + 14;
popup.setPopupPosition(left, top);
popup.show();
}
});