/** * @see org.apache.wicket.Component#isVisible() */ @Override public boolean isVisible() { return data.getLendOutBy() != null; } });
/** * @see org.apache.wicket.Component#isVisible() */ @Override public boolean isVisible() { return data.getLendOutBy() != null; } });
/** * @see org.apache.wicket.model.Model#getObject() */ @Override public String getObject() { if (data.getLendOutBy() == null) { return ""; } final StringBuffer buf = new StringBuffer(); // Show full user name: buf.append(data.getLendOutBy().getFullname()); if (data.getLendOutDate() != null) { buf.append(", "); // Show lend out date: buf.append(DateTimeFormatter.instance().getFormattedDate(data.getLendOutDate())); } return buf.toString(); } })
@Override public void populateItem(final Item<ICellPopulator<BookDO>> item, final String componentId, final IModel<BookDO> rowModel) { final BookDO book = rowModel.getObject(); final StringBuffer buf = new StringBuffer(); if (book.getLendOutBy() != null) { buf.append(userFormatter.formatUser(book.getLendOutBy())); buf.append(" "); DateTimeFormatter.instance().getFormattedDate(book.getLendOutDate()); } if (StringUtils.isNotEmpty(book.getLendOutComment()) == true) { buf.append(" ").append(book.getLendOutComment()); } final String htmlString = HtmlHelper.escapeXml(buf.toString()); final Label label = new Label(componentId, new Model<String>(htmlString)); label.setEscapeModelStrings(false); item.add(label); cellItemListener.populateItem(item, componentId, rowModel); } });