yourListBox.setModel(new ListModelList<BeanClass>(beanDao.findAll())); yourListBox.setItemRenderer(new ListItemRenderer<BeanClass>) { @Override public void render(Listitem item, BeanClass data, int index) throws Exception { Listcell cell = new Listcell(); cell.appendChild(new Label(data.getFoo())); item.appendChild(cell); } });
Listcell c = new Listcell(); Html h = new Html(); h.setContent("MY HTML STRING HERE"); c.appendChild(h); listitem.appendChild(c);
/** * Render the list item for the specified document. * * @param item List item to render. * @param doc The document associated with the list item. */ @Override public void renderItem(final Listitem item, final Document doc) { final Listcell cell = new Listcell(); item.appendChild(cell); final Div sep = new Div(); sep.setSclass("vista-documents-sep"); cell.appendChild(sep); final Div div = new Div(); div.setSclass(Constants.SCLASS_TEXT_REPORT_TITLE); cell.appendChild(div); final Hbox boxHeader = new Hbox(); final Label header = new Label(doc.getTitle()); header.setZclass(Constants.SCLASS_TEXT_REPORT_TITLE); boxHeader.appendChild(header); div.appendChild(boxHeader); Label body = new Label(doc.getBody()); body.setMultiline(true); body.setPre(true); cell.appendChild(body); }
private void renderNote(ProblemNote pn) { Listitem item = new Listitem(); lstNotes.appendChild(item); Listcell cell = addCell(item, ""); cell.setSclass("bgo-problem-icon-cell"); Toolbarbutton btn = new Toolbarbutton("", DELETE_ICON); btn.setTooltiptext("Delete this note."); btn.addForward(Events.ON_CLICK, lstNotes, "onDeleteNote"); cell.appendChild(btn); addCell(item, pn.getNumber()); // Note # addCell(item, pn.getNarrative()).setHflex("1"); // Narrative addCell(item, DateUtil.formatDate(pn.getDateAdded())); // Date added addCell(item, pn.getAuthor()); // Author item.setValue(pn); }