private String selectedItemsAsString(AbstractGrid grid) {
StringBuilder res = new StringBuilder();
Collection<IModel> selected = grid.getSelectedItems();
for (IModel model : selected) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) model.getObject();
TreeBean bean = (TreeBean)node.getUserObject();
if (res.length() > 0) {
res.append(", ");
}
res.append(bean.getProperty1());
}
return res.toString();
}