Package com.smartgwt.client.data

Examples of com.smartgwt.client.data.DataSource


    public ApplicationPanel() {
        setWidth100();
        setHeight100();
        setLayoutMargin(20);

        DataSource supplyCategoryDS = SupplyCategoryXmlDS.getInstance();
        DataSource supplyItemDS = ItemSupplyXmlDS.getInstance();

        categoryTree = new CategoryTreeGrid(supplyCategoryDS);
        categoryTree.setAutoFetchData(true);
        categoryTree.addNodeClickHandler(new NodeClickHandler() {
            public void onNodeClick(NodeClickEvent event) {
View Full Code Here


            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource eventDS = new DataSource();
        DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
        eventIdField.setPrimaryKey(true);

        DataSourceTextField nameField = new DataSourceTextField("name");
        DataSourceTextField descField = new DataSourceTextField("description");
        DataSourceDateField startDateField = new DataSourceDateField("startDate");
        DataSourceDateField endDateField = new DataSourceDateField("endDate");

        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar() {
            @Override
            protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum) {
                String returnStr = date.getDate() + "";
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource dataSource = new DataSource();
        dataSource.setRecordXPath("//default:item");
        dataSource.setDataURL("http://rss.slashdot.org/Slashdot/slashdot");

        DataSourceTextField titleField = new DataSourceTextField("title", "Title");
        DataSourceLinkField linkField = new DataSourceLinkField("link", "URL");

        dataSource.setFields(titleField, linkField);

        ListGrid grid = new ListGrid();
        grid.setDataSource(dataSource);
        grid.setWidth100();
        grid.setHeight(300);
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource eventDS = new DataSource();
        DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
        eventIdField.setPrimaryKey(true);

        DataSourceTextField nameField = new DataSourceTextField("name");
        DataSourceTextField descField = new DataSourceTextField("description");
        DataSourceDateField startDateField = new DataSourceDateField("startDate");
        DataSourceDateField endDateField = new DataSourceDateField("endDate");

        eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
        eventDS.setClientOnly(true);
        eventDS.setTestData(CalendarData.getRecords());

        Calendar calendar = new Calendar();
        calendar.setDataSource(eventDS);
        calendar.setAutoFetchData(true);
View Full Code Here

    public Canvas getViewPanel() {

        Canvas canvas = new Canvas();

        DataSource countryDS = new DataSource();
        countryDS.setClientOnly(true);
        DataSourceTextField countryCode = new DataSourceTextField("countryCode", "Code");
        countryCode.setPrimaryKey(true);
        countryCode.setCanEdit(false);

        DataSourceTextField countryName = new DataSourceTextField("countryName", "Country");
        DataSourceTextField capital = new DataSourceTextField("capital", "Capital");
        countryDS.setFields(countryCode, countryName, capital);

        countryDS.setOperationBindings();

        OperationBinding fetch = new OperationBinding(DSOperationType.FETCH, "data/dataIntegration/xml/responses/country_fetch.xml");
        OperationBinding add = new OperationBinding(DSOperationType.ADD, "data/dataIntegration/xml/responses/country_add.xml");
        OperationBinding update = new OperationBinding(DSOperationType.UPDATE, "data/dataIntegration/xml/responses/country_update.xml");
        OperationBinding remove = new OperationBinding(DSOperationType.REMOVE, "data/dataIntegration/xml/responses/country_remove.xml");

        countryDS.setOperationBindings(fetch, add, update, remove);

        final ListGrid countryGrid = new ListGrid();
        countryGrid.setWidth(500);
        countryGrid.setHeight(224);
        countryGrid.setDataSource(countryDS);
View Full Code Here

            record.setAttribute("title", "Field " + i);
            record.setAttribute("type", "text");
            testData[i] = record;
        }

        DataSource bigFilterDS = new DataSource();
        bigFilterDS.setClientOnly(true);

        DataSourceTextField nameField = new DataSourceTextField("name");
        DataSourceTextField titleField = new DataSourceTextField("title");
        DataSourceTextField typeField = new DataSourceTextField("type");

        bigFilterDS.setFields(nameField, titleField, typeField);
        bigFilterDS.setTestData(testData);

        FilterBuilder filterBuilder = new FilterBuilder();
        filterBuilder.setFieldDataSource(bigFilterDS);

View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource dataSource = OrderItemLocalDS.getInstance();

        final DateTimeFormat dtf = DateTimeFormat.getFormat("MMM d, yyyy");


        ListGridField orderIdField = new ListGridField("orderID");
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        DataSource dataSource = new DataSource() {
            @Override
            protected void transformResponse(DSResponse response, DSRequest request, Object jsonData) {
                JSONArray value = XMLTools.selectObjects(jsonData, "/response/status");
                String status = ((JSONString)value.get(0)).stringValue();
                if(!status.equals("success")) {
                    response.setStatus(RPCResponse.STATUS_VALIDATION_ERROR);
                    JSONArray errors = XMLTools.selectObjects(jsonData, "/response/errors");
                    response.setErrors(errors.getJavaScriptObject());
                }
            }
        };
        dataSource.setDataFormat(DSDataFormat.JSON);
        dataSource.setDataURL("data/dataIntegration/json/serverValidationErrors/serverResponse.js");
        DataSourceTextField userNameField = new DataSourceTextField("userName", "Username", 50, true);
        DataSourceTextField firstNameField = new DataSourceTextField("firstName", "First Name", 50, true);
        DataSourceTextField lastNameField = new DataSourceTextField("lastName", "Last Name", 50, true);
        DataSourceTextField emailField = new DataSourceTextField("email", "Email", 100, true);

        DataSourcePasswordField passwordField = new DataSourcePasswordField("password", "Password", 20, true);

        dataSource.setFields(userNameField, firstNameField, lastNameField, emailField, passwordField);


        final DynamicForm form = new DynamicForm();
        form.setDataSource(dataSource);
        form.setUseAllDataSourceFields(true);
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        DataSource supplyItemDS = ItemSupplyXmlDS.getInstance();

        final DynamicForm form = new DynamicForm();
        form.setWidth(500);
        form.setNumCols(4);
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        DataSource worldDS = WorldXmlDS.getInstance();

        final FilterBuilder filterBuilder = new FilterBuilder();       
        filterBuilder.setDataSource(worldDS);
        filterBuilder.setTopOperatorAppearance(TopOperatorAppearance.RADIO);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.data.DataSource

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.