Package org.apache.click.dataprovider

Examples of org.apache.click.dataprovider.DataProvider


    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


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

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

            public List getData() {
                return customerService.getInvestmentCategories();
            }
        });
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

    // 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 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

    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

     * @return the Option list
     */
    public List<Option> getOptionList() {
        if (optionList == null) {

            DataProvider dp = getDataProvider();

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

                if (iterableData instanceof List) {
                    // Set optionList to data
                    setOptionList((List) 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.