Ejemplo n.º 1
0
 /**
  * *********************************************************** 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.");
 }
Ejemplo n.º 2
0
  @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();
  }