}
private ListView<ISIResponse> makeResponseListView(
Entry<ISIPrompt, List<ISIResponse>> entry) {
final ISIPrompt currentPrompt = entry.getKey();
return new ListView<ISIResponse>("responseList", entry.getValue()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ISIResponse> item) {
// Anchor so links can jump to this id
item.add(new WebMarkupContainer("responseAnchor")
.add(new SimpleAttributeModifier("name", String.valueOf(item.getModelObject().getId()))));
// Actual response
item.add(factory.makeResponseViewComponent("response", item.getModel()));
// Remove From Notebook button
NotebookRemoveDialog removeDialog = new NotebookRemoveDialog("removeModal", item.getModel());
item.add(removeDialog);
Component removeLink = new WebMarkupContainer("removeLink").add(removeDialog.getClickToOpenBehavior());
removeLink.setVisible(!isTeacher);
item.add(removeLink);
// Link back to content
BookmarkablePageLink<ISIStandardPage> editLink = new SectionLinkFactory().linkTo(
"editLink",
currentPrompt.getContentElement().getContentLocObject().getSection(),
currentPrompt.getContentElement().getXmlId());
editLink.add(new ClassAttributeModifier("sectionLink"));
item.add(editLink);
}
};