Collection<IEmployee> employees = (Collection) model.get("employees");
// Create the simple text message:
SimpleText message = new SimpleText(new StringBuilder("Selected office: ").append(office.getName()).toString());
// Create an ajax action for setting the message and hi:
ReplaceContentAction setMessageAction = new ReplaceContentAction("message", message);
// Create an highlighting effect action for the appearing message:
Effect highlightAction = new Effect("Highlight", "message");
highlightAction.addOption("duration", 0.5);
// Create the components to render (a list of html table rows):
List rows = new LinkedList();
for(IEmployee emp : employees) {
TableRow row = new TableRow(emp, new String[]{"firstname", "surname", "matriculationCode"}, null);
rows.add(row);
}
// Create an ajax action for replacing the old table body content, inserting these new rows:
ReplaceContentAction replaceRowsAction = new ReplaceContentAction("employees", rows);
// Create a concrete ajax response:
AjaxResponse response = new AjaxResponseImpl();
// Add actions:
response.addAction(setMessageAction);