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


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

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

        buttonAlignSelect = new Select("buttonAlign");
        buttonAlignSelect.addAll(new String[] { "left", "center", "right" });
        buttonAlignSelect.setTitle("Buttons horizontal alignment");
        buttonAlignSelect.setAttribute("onchange", "optionsForm.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", "optionsForm.submit();");
        fieldSet.add(columnsSelect);

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

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

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

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

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

        labelsPositionSelect = new Select("labelsPosition");
        labelsPositionSelect.addAll(new String[] {"left", "top"});
        labelsPositionSelect.setTitle("Form labels position");
        labelsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
        fieldSet.add(labelsPositionSelect);
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

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

        // Gender Select - populated through a DataProvider
        genderSelect = new Select("gender");
        genderSelect.setRequired(true);

        genderSelect.setDefaultOption(new Option("U", ""));
        genderSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List optionList = new ArrayList(3);
                optionList.add(new Option("M", "Male"));
                optionList.add(new Option("F", "Female"));
                return optionList;
            }
        });

        form.add(genderSelect);

        // Investment Select - populated through Select.add methods
        List investmentOptions = new ArrayList();

        OptionGroup property = new OptionGroup("property");
        property.add(new Option("Commercial 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

    public StartPage() {
        addControl(form);
        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

        addControl(form);

        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

     * @param page the wizard page
     */
    public Step1(String name, String label, String description, WizardPage page) {
        super(name, label, description, page);

        Select titleSelect = createTitleSelect();
        getForm().add(titleSelect);

        getForm().add(new TextField("firstName", true));
        getForm().add(new TextField("lastName", true));
        getForm().add(new DateField("dateJoined", true));
View Full Code Here

        }
        return clientService;
    }

    private Select createTitleSelect() {
        Select titleSelect = new Select("title", true);

        titleSelect.setDefaultOption(Option.EMPTY_OPTION);

        titleSelect.setDataProvider(new DataProvider() {

            public List<Option> getData() {
                List<Option> options = new ArrayList<Option>();
                List<SystemCode> titles = getClientService().getTitles();
                for (SystemCode title : titles) {
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

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.