}
add(new Link("search") {
public void onClick() {
setCurrentSpace(space);
ItemSearch itemSearch = new ItemSearch(space);
setResponsePage(ItemSearchFormPage.class, itemSearch.getAsQueryString());
}
});
add(new IndicatingAjaxLink("link") {
public void onClick(AjaxRequestTarget target) {
Counts tempCounts = counts;
// avoid hitting the database again if re-expanding
if (!tempCounts.isDetailed()) {
tempCounts = getJtrac().loadCountsForUserSpace(user, space);
}
DashboardRowExpandedPanel dashboardRow = new DashboardRowExpandedPanel("dashboardRow", usr, tempCounts);
DashboardRowPanel.this.replaceWith(dashboardRow);
target.addComponent(dashboardRow);
}
});
if(user.getId() > 0) {
add(new Link("loggedByMe") {
public void onClick() {
setCurrentSpace(space);
ItemSearch itemSearch = new ItemSearch(space);
itemSearch.setLoggedBy(user);
// setCurrentItemSearch(itemSearch);
setResponsePage(ItemListPage.class, itemSearch.getAsQueryString());
}
}.add(new Label("loggedByMe", new PropertyModel(counts, "loggedByMe"))));
add(new Link("assignedToMe") {
public void onClick() {
setCurrentSpace(space);
ItemSearch itemSearch = new ItemSearch(space);
itemSearch.setAssignedTo(user);
// setCurrentItemSearch(itemSearch);
setResponsePage(ItemListPage.class, itemSearch.getAsQueryString());
}
}.add(new Label("assignedToMe", new PropertyModel(counts, "assignedToMe"))));
} else {
add(new WebMarkupContainer("loggedByMe").setVisible(false));
add(new WebMarkupContainer("assignedToMe").setVisible(false));
}
add(new Link("total") {
public void onClick() {
setCurrentSpace(space);
ItemSearch itemSearch = new ItemSearch(space);
// setCurrentItemSearch(itemSearch);
setResponsePage(ItemListPage.class, itemSearch.getAsQueryString());
}
}.add(new Label("total", new PropertyModel(counts, "total"))));
}