Package org.apache.click.dataprovider

Examples of org.apache.click.dataprovider.DataProvider


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

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

            public List getData() {
                List<Option> optionList = new ArrayList<Option>();
                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<Option> optionList = new ArrayList<Option>();

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

            }
        });
    }

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

            public List getData() {
                List<Option> optionList = new ArrayList<Option>();

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

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

        customerSelect.setSize(8);

        customerSelect.setDataProvider(new DataProvider() {

            public List getData() {
                List<Option> optionList = new ArrayList<Option>();
                List<Customer> customerList = customerService.getCustomersSortedByName(8);
                for (Customer customer : customerList) {
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

        setupExporter(table3);
        table3.setExportAttachment(ExportTable.EXPORTER_INLINE);

        // A simple caching dataProvider that only retrieves customers once
        DataProvider dataProvider = new DataProvider() {

            List<Customer> customers;

            public List<Customer> getData() {
                if (customers == null) {
View Full Code Here

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

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

            public List<Option> getData() {
                List<Option> options = new ArrayList<Option>();
                for (String category : customerService.getInvestmentCategories()) {
                    options.add(new Option(category));
View Full Code Here

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

            Option defaultOption = getDefaultOption();

            DataProvider dp = getDataProvider();

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

                if (iterableData instanceof List) {
                    // Set optionList to data
                    List listData = (List) iterableData;
                    if (defaultOption != null) {
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.