/** * *********************************************************** Search * *********************************************************** */ @Listen("onClick = #searchBtn") public void search() { String searchTerm = searchBox.getValue(); List<Node> nodes = nodeDao.matchByLabel("%" + searchTerm + "%"); ListModelList<Node> nodeModel = new ListModelList<Node>(nodes); nodeList.setModel(nodeModel); nodeList.setItemRenderer(new NodeRenderer()); footer.setLabel(nodes.size() + " nodes found."); }
@Listen("onClick = #addBtn") public void add() throws InterruptedException { Node node = nodeList.getSelectedItem().getValue(); node = nodeDao.loadById(node.getId()); AbstractQuestionRelation p = (AbstractQuestionRelation) getParent(); node.getGroups().addAll((p.getQuestion().getAvailableGroups())); nodeDao.save(node); // update interface p.refreshWholePage(); }