if (sessionData != null)
{
ArrayList<RequestData> returnValues = new ArrayList<RequestData>();
for (int i = 0; i < requests.size(); i++)
{
RequestData data = requests.get(i);
if (sessionData.getSessionId().equals(data.getSessionId()))
{
returnValues.add(data);
}
}
return returnValues;
}
return new ArrayList<RequestData>(requests);
}
};
PageableListView<RequestData> listView = new PageableListView<RequestData>("requests",
requestsModel, 50)
{
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<RequestData> item)
{
RequestData rd = item.getModelObject();
item.add(new Label("id", new Model<String>(rd.getSessionId())).setVisible(sessionData == null));
item.add(new Label("startDate", new Model<String>(sdf.format(rd.getStartDate()))));
item.add(new Label("timeTaken", new Model<Long>(rd.getTimeTaken())));
item.add(new Label("eventTarget", new Model<String>(rd.getEventTarget())));
item.add(new Label("responseTarget", new Model<String>(rd.getResponseTarget())));
item.add(new Label("alteredObjects", new Model<String>(rd.getAlteredObjects())))
.setEscapeModelStrings(false);
item.add(new Label("sessionSize", new Model<Bytes>(Bytes.bytes(rd.getSessionSize()
.longValue()))));
}
};
add(listView);