@Override protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { if (addSolutionLink == source) { doAddSolution(ureq); } else if (createSolutionLink == source) { doCreateSolution(ureq); } else if (solutionTable == source) { if (event instanceof SelectionEvent) { SelectionEvent se = (SelectionEvent) event; SolutionRow row = solutionModel.getObject(se.getIndex()); if ("edit".equals(se.getCommand())) { doEdit(ureq, row.getSolution()); } else if ("delete".equals(se.getCommand())) { doDelete(ureq, row); } } } super.formInnerEvent(ureq, source, event); }
private void updateModel() { List<Solution> solutionList = solutions.getSolutions(); List<SolutionRow> rows = new ArrayList<>(solutionList.size()); for (Solution solution : solutionList) { String filename = solution.getFilename(); String author = null; VFSItem item = solutionContainer.resolve(filename); if (item instanceof MetaTagged) { MetaInfo metaInfo = ((MetaTagged) item).getMetaInfo(); if (metaInfo != null && metaInfo.getAuthorIdentityKey() != null) { author = userManager.getUserDisplayName(metaInfo.getAuthorIdentityKey()); } } rows.add(new SolutionRow(solution, author)); } solutionModel.setObjects(rows); solutionTable.reset(); }