Beispiel #1
0
 private void addContainerproperties() {
   /* Create HierarchicalContainer container */
   container.addContainerProperty(SPUILabelDefinitions.NAME, Link.class, null);
   container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_USER, String.class, null);
   container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, Date.class, null);
   container.addContainerProperty(SPUILabelDefinitions.VAR_MODIFIED_DATE, Date.class, null);
   container.addContainerProperty(SPUILabelDefinitions.VAR_MODIFIED_BY, String.class, null);
   container.addContainerProperty(
       SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET, String.class, null);
 }
  protected void replaceToCombo(String key, String query) {
    Container container = new HierarchicalContainer();
    container.addContainerProperty("id", String.class, "");
    String defaultValue = null;
    try {
      Connection connection = DriverManager.getConnection("jdbc:sqlite:ivan.db3");
      try {
        ResultSet rs = connection.createStatement().executeQuery(query);
        while (rs.next()) {
          defaultValue = rs.getString(1);
          container.addItem(defaultValue).getItemProperty("id").setValue(defaultValue);
        }
      } finally {
        connection.close();
      }
    } catch (Exception ex) {

    }

    replaceToCombo(key, container, defaultValue);
  }