Example #1
0
  public AddNodeWindow(AbstractQuestionRelation p) {
    this.setParent(p);

    // create ui from template
    Executions.createComponents("/WEB-INF/zk/survey/design/AddNodeWindow.zul", this, null);
    Selectors.wireVariables(this, this, Selectors.newVariableResolvers(getClass(), Div.class));
    Selectors.wireComponents(this, this, false);
    Selectors.wireEventListeners(this, this);

    // type box and default selection
    ntds = nodeRO.getNodeTypeDescriptions();
    ListModelList<String> typeModel = new ListModelList<String>();
    for (Map<String, String> ntd : ntds) {
      String nodeTypeLabel = ntd.get("label");
      typeModel.add(nodeTypeLabel);
    }
    String defaultContactType = p.getQuestion().getDefaultNewContactType();
    if (defaultContactType != null) {
      Map<String, String> ntd = GeneralUtil.getNodeDescription(ntds, defaultContactType);
      if (ntd != null) {
        String nodeTypeLabel = ntd.get("label");
        typeModel.addToSelection(nodeTypeLabel);
      }
    }
    typeBox.setModel(typeModel);
    onNodeTypeChanged();

    this.setWidth("200px");
    this.setVflex("1");
    this.setClosable(true);
  }
  private void processRecursive(Component comp, Object composer) {
    Selectors.wireComponents(comp, composer, false);
    Selectors.wireEventListeners(comp, composer);

    List<Component> compList = comp.getChildren();
    for (Component vComp : compList) {
      if (vComp instanceof Window) {
        processRecursive(vComp, composer);
      }
    }
  }
Example #3
0
 public void setLoad(boolean load) {
   this.load = load;
   Executions.createComponents("/pages/composite/viewWindow.zul", this, null);
   Selectors.wireComponents(this, this, false);
   Selectors.wireEventListeners(this, this);
 }
Example #4
0
 /**
  * @param comp
  * @param controller
  */
 private static void wireController(Component comp, Object controller) {
   Selectors.wireVariables(comp, controller, null);
   Selectors.wireComponents(comp, controller, true);
   Selectors.wireEventListeners(comp, controller);
 }