Package org.apache.click.control

Examples of org.apache.click.control.Select


    public SearchForm() {
        textField = new TextField("search");
        form.add(textField);

        typeSelect = new Select("type");
        typeSelect.addAll(new String[] {"ID", "Name", "Age"});
        typeSelect.setValue("Name");
        typeSelect.setStyle("font-size", "9pt");
        form.add(typeSelect);
View Full Code Here


    // ------------------------------------------------------------ Constructor

    public StartPage() {
        form.setLabelsPosition("top");

        customerSelect = new Select("Customer");
        customerSelect.setRequired(true);
        form.add(customerSelect);

        dateField = new DateField("Booking Date");
        dateField.setRequired(true);
View Full Code Here

    public SelectDemo() {
        form.setErrorsPosition(Form.POSITION_TOP);

        // Gender Select
        genderSelect = new Select("gender");
        genderSelect.setRequired(true);
        genderSelect.add(new Option("U", ""));
        genderSelect.add(new Option("M", "Male"));
        genderSelect.add(new Option("F", "Female"));
        form.add(genderSelect);

        // Investment Select
        List investmentOptions = new ArrayList();

        OptionGroup property = new OptionGroup("property");
        property.add(new Option("Commerical Property", "Commercial"));
        property.add(new Option("Residential Property", "Residential"));
        investmentOptions.add(property);

        OptionGroup securities = new OptionGroup("securities");
        securities.add(new Option("Bonds"));
        securities.add(new Option("Options"));
        securities.add(new Option("Stocks"));
        investmentOptions.add(securities);

        investmentSelect = new Select("investment");
        investmentSelect.setOptionList(investmentOptions);
        investmentSelect.setMultiple(true);
        investmentSelect.setRequired(true);
        investmentSelect.setSize(7);
        form.add(investmentSelect);

        // Location Select
        locationSelect = new Select("location");
        locationSelect.add("QLD");
        locationSelect.add("NSW");
        locationSelect.add("NT");
        locationSelect.add("SA");
        locationSelect.add("TAS");
View Full Code Here

        optionsForm.setLabelStyle("padding-left:2em;");

        fieldSet = new FieldSet("props", "<b>Form Properties</b>");
        optionsForm.add(fieldSet);

        buttonAlignSelect = new Select("buttonAlign");
        buttonAlignSelect.addAll(new String[] { "left", "center", "right" });
        buttonAlignSelect.setTitle("Buttons horizontal alignment");
        buttonAlignSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(buttonAlignSelect);

        columnsSelect = new Select("columns");
        columnsSelect.addAll(new String[] { "1", "2", "3", "4" });
        columnsSelect.setTitle("Number of Form table columns");
        columnsSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(columnsSelect);

        buttonStyle = new TextField("buttonStyle");
        buttonStyle.setTitle("Button td style attribute");
        buttonStyle.setAttribute("onchange", "form.submit();");
        fieldSet.add(buttonStyle);

        errorsAlignSelect = new Select("errorsAlign");
        errorsAlignSelect.addAll(new String[] { "left", "center", "right" });
        errorsAlignSelect.setTitle("Errors block horizontal alignment");
        errorsAlignSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(errorsAlignSelect);

        errorsPositionSelect = new Select("errorsPosition");
        errorsPositionSelect.addAll(new String[] { "top", "middle", "bottom" });
        errorsPositionSelect.setTitle("Form errors position");
        errorsPositionSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(errorsPositionSelect);

        errorsStyle = new TextField("errorsStyle");
        errorsStyle.setTitle("Errors td style attribute");
        errorsStyle.setAttribute("onchange", "form.submit();");
        fieldSet.add(errorsStyle);

        labelAlignSelect = new Select("labelAlign");
        labelAlignSelect.addAll(new String[] { "left", "center", "right" });
        labelAlignSelect.setTitle("Field label alignment");
        labelAlignSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(labelAlignSelect);

        labelsPositionSelect = new Select("labelsPosition");
        labelsPositionSelect.addAll(new String[] {"left", "top"});
        labelsPositionSelect.setTitle("Form labels position");
        labelsPositionSelect.setAttribute("onchange", "form.submit();");
        fieldSet.add(labelsPositionSelect);
View Full Code Here

    public SearchForm() {
        textField = new TextField("search");
        form.add(textField);

        typeSelect = new Select("type");
        typeSelect.addAll(new String[] {"ID", "Name", "Age"});
        typeSelect.setValue("Name");
        typeSelect.setStyle("font-size", "9pt");
        form.add(typeSelect);
View Full Code Here

    // Constructor ------------------------------------------------------------

    public StartPage() {
        form.setLabelsPosition("top");

        customerSelect = new Select("Customer");
        customerSelect.setRequired(true);
        form.add(customerSelect);

        customerSelect.setDefaultOption(Option.EMPTY_OPTION);
        customerSelect.setDataProvider(new DataProvider() {
View Full Code Here

    if(form.isValid()) {
      TextField fullName = (TextField)bFieldset.getControl("authorFullName");
      String[] fullNameArr = fullName.getValue().trim().split("[,]");
      TextField fPublisher = (TextField)bFieldset.getControl("publisher");
      TextField fIsbn = (TextField)bFieldset.getControl("isbn");
      Select fPubDate = (Select)bFieldset.getControl("pubDate");
      TextField fSupplier = (TextField)bFieldset.getControl("supplier");
      TextField fCkey = (TextField)bFieldset.getControl("classKey");
      TextField fClass = (TextField)bFieldset.getControl("classDescription");
      NumberField fQtty = (NumberField)bFieldset.getControl("quantity");
     
      ConnectionSource conn = (JdbcConnectionSource) GetConnection();
     
      Author a = new Author();
      if(fullNameArr.length > 1) {
        a = a.getByFullName(conn, author, fullNameArr);
        Integer author_id = a.getId();
        if (author_id != 0 && author_id != null) {
          if(fullNameArr.length > 2) {
            if (!a.getLname().equalsIgnoreCase(fullNameArr[1]) ||
                !a.getMname().equalsIgnoreCase(fullNameArr[2]) ||
                !a.getName().equalsIgnoreCase(fullNameArr[0]))
              author.update(a);
          } else if (fullNameArr.length == 2) {
            if (!a.getLname().equalsIgnoreCase(fullNameArr[1]) ||
                !a.getName().equalsIgnoreCase(fullNameArr[0]))
              author.update(a);
          }
          author.refresh(a);       
        } else {
          a = new Author(fullNameArr);
          author.create(a);
          author.refresh(a);
        }
      }
     
      Publisher p = new Publisher();
      if(!fPublisher.getValue().trim().isEmpty()) {
        p = p.getByName(conn, publisher,
            fPublisher.getValue().trim());
        Integer publisher_id = p.getId();
        if(publisher_id != 0 && publisher_id != null) {
          if(!p.getName().equalsIgnoreCase(fPublisher.getValue().trim()))
            publisher.update(p);
          publisher.refresh(p);
        } else {
          p = new Publisher(fPublisher.getValue().trim());
          publisher.create(p);
          publisher.refresh(p);
        }
      }
     
      Supplier s = new Supplier();
      if(!fSupplier.getValue().isEmpty()) {
        s.getByName(conn, supplier,
            fSupplier.getValue());
        Integer supplier_id = s.getId();
        if(supplier_id != 0 && supplier_id != null) {
          if(!s.getName().equalsIgnoreCase(fSupplier.getValue())) {
            supplier.update(s);
            supplier.refresh(s);
          }
        } else {
          s = new Supplier(fSupplier.getValue());
          supplier.create(s);
          supplier.refresh(s);
        }
      }
     
      Classification c = new Classification();
      if(!fCkey.getValue().isEmpty() &&
          !fClass.getValue().isEmpty()) {
        c.getByClassification(conn, classification,
            fCkey.getValue(), fClass.getValue());
        Integer class_id = c.getId();
        if(class_id != 0 && class_id != null) {
          if(!c.getDescription().equalsIgnoreCase(fClass.getValue())) {
            classification.update(c);
          }
          if(!c.getCkey().equalsIgnoreCase(fCkey.getValue())) {
            classification.update(c);
          }
          classification.refresh(c);
        } else {
          c = new Classification(fCkey.getValue(), fClass.getValue());
          classification.create(c);
          classification.refresh(c);
        }
      }
     
      Book b = new Book();
      form.copyTo(b);
      try {
        ISBN validIsbn = new ISBN(fIsbn.getValue());
        b.setIsbn(validIsbn.toString());
      } catch (InvalidStandardIDException e) {
        // TODO Auto-generated catch block
        b.setIsbn("");
        e.printStackTrace();
      }
      DateFormat df = new SimpleDateFormat("yyyy");
      Date year = df.parse(fPubDate.getSelectedValues().get(0).toString());
     
      if(year != null)
        b.setPubdate(year);
     
      if(a != null)
View Full Code Here

   
    TextField fullName = (TextField)bFieldset.getControl("authorFullName");
    String[] fullNameArr = fullName.getValue().trim().split("[,]");
    TextField fPublisher = (TextField)bFieldset.getControl("publisher");
    TextField fIsbn = (TextField)bFieldset.getControl("isbn");
    Select fPubDate = (Select)bFieldset.getControl("pubDate");
    TextField fSupplier = (TextField)bFieldset.getControl("supplier");
    TextField fCkey = (TextField)bFieldset.getControl("classKey");
    TextField fClass = (TextField)bFieldset.getControl("classDescription");

    BookLookup lookup = new BookLookup();
View Full Code Here

TOP

Related Classes of org.apache.click.control.Select

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.