Package org.apache.click.dataprovider

Examples of org.apache.click.dataprovider.DataProvider


    public void onInit() {
        super.onInit();

        customerSelect.setSize(8);

        customerSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List<Option> optionList = new ArrayList();
                List<Customer> customerList = customerService.getCustomersSortedByName(8);
                for (Customer customer : customerList) {
View Full Code Here


    // Private Methods --------------------------------------------------------

    @SuppressWarnings("serial")
    private void populateStateData() {
        state.setDataProvider(new DataProvider() {

            public List getData() {
                List optionList = new ArrayList();
                optionList.add(new Option(EASTERN_CAPE, "Eastern Cape"));
                optionList.add(new Option(FREE_STATE, "Free State"));
View Full Code Here

            }
        });
    }

    private void populateCityData(final String stateCode) {
        city.setDataProvider(new DataProvider() {

            public List getData() {
                List optionList = new ArrayList();

                if (EASTERN_CAPE.equals(stateCode)) {
View Full Code Here

            }
        });
    }

    private void populateSuburbData(final String cityCode) {
        suburb.setDataProvider(new DataProvider() {

            public List getData() {
                List optionList = new ArrayList();

                if (cityCode.equals("Port Elizabeth")) {
View Full Code Here

        // Set default non-selecting option
        select.setDefaultOption(new Option("[Select]"));

        // Create dataprovider for Select
        DataProvider dp = new DataProvider() {
            public List getData() {
                return createOptionList(customerService.getCustomers());
            }
        };
        select.setDataProvider(dp);
View Full Code Here

        return true;
    }

    public DataProvider createDataProvider() {
        DataProvider dp = new DataProvider() {
            public List<Customer> getData() {
                return customerService.getCustomersSortedByName(NUM_ROWS);
            }
        };
View Full Code Here

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

        customerSelect.setDefaultOption(Option.EMPTY_OPTION);
        customerSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List optionList = new ArrayList();
                List<Customer> customerList = customerService.getCustomers();
                for (Customer customer : customerList) {
View Full Code Here

    @Override
    public void onInit() {
        super.onInit();

        investmentSelect.setDefaultOption(Option.EMPTY_OPTION);
        investmentSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List categories = customerService.getInvestmentCatetories();
                return categories;
            }
View Full Code Here

    public List getOptionList() {
        if (optionList == null) {

            optionList = new ArrayList();

            DataProvider dp = getDataProvider();

            if (dp != null) {
                Iterable iterableData = dp.getData();

                // Create and populate the optionList from the Iterable data
                if (iterableData instanceof Collection) {
                    // Popuplate optionList from options
                    addAll((Collection) iterableData);
View Full Code Here

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

        customerSelect.setDefaultOption(Option.EMPTY_OPTION);
        customerSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List<Option> optionList = new ArrayList<Option>();
                List<Customer> customerList = customerService.getCustomers();
                for (Customer customer : customerList) {
View Full Code Here

TOP

Related Classes of org.apache.click.dataprovider.DataProvider

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.