private static final String OFFICE_ID = "officeId";
private MemoryRepository store;
public AjaxResponse dragEmployee(AjaxActionEvent event) {
IEmployee draggedEmployee = store.getEmployee(event.getParameters().get(EMPLOYEE_ID));
IOffice droppableOffice = store.getOffice(event.getHttpRequest().getParameter(OFFICE_ID));
if (! droppableOffice.getEmployees().contains(draggedEmployee)) {
BindStatusHelper helper = new BindStatusHelper("command.employees");
ListItem item = new ListItem(new SimpleText(draggedEmployee.getFirstname() + " " + draggedEmployee.getSurname()));
InputField hidden = new InputField(helper.getStatusExpression(), draggedEmployee.getMatriculationCode(), InputField.InputType.HIDDEN);
AppendContentAction appendAction = new AppendContentAction("employees", new LinkedList<Component>(Arrays.asList(item, hidden)));
AjaxResponse response = new AjaxResponseImpl();
response.addAction(appendAction);