private ListView getCommentListView(final Thread thread) { commentListView = new PageableListView("commentListView", commentController.getActiveComment(thread), 20) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { final Comment comment = (Comment) item.getModelObject(); item.add(new Label("commentAuthor", comment.getOwner().getLogin())); item.add(new Label("commentCreateDate", dateFormat.format(comment.getCreateDate()))); item.add(new MultiLineLabel("commentName", comment.getName())); Link noticeLink = new Link("noticeLink", item.getModel()) { private static final long serialVersionUID = 1L; @Override public void onClick() { commentController.noticeUp(comment); feedbackPanel.info("Koment�r bol upozornen�"); } }; noticeLink.add( new SimpleAttributeModifier( "onclick", "return confirm('Chcete upozorni� na koment�r?');")); item.add(noticeLink); Link deactivateLink = new Link("deactivate", item.getModel()) { private static final long serialVersionUID = 1L; @Override public void onClick() { Comment selectedComment = (Comment) getModelObject(); selectedComment.setState(false); commentController.updateComment(selectedComment); setResponsePage(new CommentList(thread)); feedbackPanel.info("Koment�r bol �spe�ne zmazan�"); } }; deactivateLink.add( new SimpleAttributeModifier( "onclick", "return confirm('Chcete zmaza� dan� koment�r?');")); item.add(deactivateLink); if (!comment.getOwner().getLogin().equals(login)) { deactivateLink.setVisible(false); } } }; add((new PagingNavigator("navigator", commentListView))); return commentListView; }