Package com.smartgwt.client.data

Examples of com.smartgwt.client.data.DataSource


    public Canvas getViewPanel() {

        Canvas canvas = new Canvas();

        DataSource supplyItemDS = ItemSupplyXmlDS.getInstance();

        final Label label = new Label();
        label.setAlign(Alignment.CENTER);
        label.setBorder("1px solid #287fd6");
        label.setTop(75);
View Full Code Here


            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource dataSource = new DataSource();
        dataSource.setDataFormat(DSDataFormat.JSON);
        dataSource.setDataURL("data/dataIntegration/json/contactsData.js");

        DataSourceTextField nameField = new DataSourceTextField("name", "Name");
        DataSourceTextField emailField = new DataSourceTextField("email", "Email");
        DataSourceTextField orgField = new DataSourceTextField("organization", "Organization");
        DataSourceTextField phoneField = new DataSourceTextField("phone", "Phone");

        DataSourceTextField streetField = new DataSourceTextField("street", "Street");
        streetField.setValueXPath("address/street");

        DataSourceTextField cityField = new DataSourceTextField("city", "City");
        cityField.setValueXPath("address/city");

        DataSourceTextField stateField = new DataSourceTextField("state", "State");
        stateField.setValueXPath("address/state");

        DataSourceTextField zipField = new DataSourceTextField("zip", "Zip");
        zipField.setValueXPath("address/zip");

        dataSource.setFields(nameField, emailField, orgField, phoneField, streetField, cityField, stateField, zipField);

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

        yahooAttribution.setContents("<a href='http://developer.yahoo.net/about'>"
                + "<img src='http://l.yimg.com/a/i/us/nt/bdg/websrv_88_1.gif' border='0'>"
                + "</a>");
        canvas.addChild(yahooAttribution);

        DataSource yahooDS = new DataSource();
        yahooDS.setDataURL("http://api.search.yahoo.com/ImageSearchService/V1/imageSearch");
        yahooDS.setRecordXPath("/yahoo:ResultSet/yahoo:Result");

        XmlNamespaces xmlNamespaces = new XmlNamespaces();
        xmlNamespaces.addNamespace("yahoo", "urn:yahoo:srchmi");
        yahooDS.setXmlNamespaces(xmlNamespaces);

        DataSourceImageField thumbnail = new DataSourceImageField("Thumbnail", "Thumbnail");
        thumbnail.setWidth(150);
        thumbnail.setImageHeight("imageHeight");
        thumbnail.setImageWidth("imageWidth");
        thumbnail.setValueXPath("yahoo:Thumbnail/yahoo:Url");

        DataSourceIntegerField imageWidth = new DataSourceIntegerField("imageWidth");
        imageWidth.setValueXPath("yahoo:Thumbnail/yahoo:Width");
        imageWidth.setAttribute("hidden", true);

        DataSourceIntegerField imageHeight = new DataSourceIntegerField("imageHeight");
        imageHeight.setValueXPath("yahoo:Thumbnail/yahoo:Height");
        imageHeight.setAttribute("hidden", true);

        DataSourceField title = new DataSourceField("Title", FieldType.TEXT);
        DataSourceField summary = new DataSourceField("Summary", FieldType.TEXT);

        DataSourceLinkField fullImage = new DataSourceLinkField("link", "Full Image");
        fullImage.setValueXPath("yahoo:Url");
        fullImage.setAttribute("target", "_blank");

        yahooDS.addField(thumbnail);
        yahooDS.addField(imageWidth);
        yahooDS.addField(imageHeight);
        yahooDS.addField(title);
        yahooDS.addField(summary);
        yahooDS.addField(fullImage);

        final ListGrid grid = new ListGrid();
        grid.setTop(120);
        grid.setWidth100();
        grid.setHeight(300);
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        DataSource worldDS = WorldXmlDS.getInstance();

        final FilterBuilder filterBuilder = new FilterBuilder();
        filterBuilder.setDataSource(worldDS);

        final ListGrid countryGrid = new ListGrid();
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource dataSource = new DataSource();
        dataSource.setDataFormat(DSDataFormat.XML);
        dataSource.setRecordXPath("//contact");
        dataSource.setDataURL("data/dataIntegration/xml/contactsData.xml");

        DataSourceTextField nameField = new DataSourceTextField("name", "Name");
        DataSourceTextField emailField = new DataSourceTextField("email", "Email");
        DataSourceTextField orgField = new DataSourceTextField("organization", "Organization");
        DataSourceTextField phoneField = new DataSourceTextField("phone", "Phone");

        DataSourceTextField streetField = new DataSourceTextField("street", "Street");
        streetField.setValueXPath("address/street");

        DataSourceTextField cityField = new DataSourceTextField("city", "City");
        cityField.setValueXPath("address/city");

        DataSourceTextField stateField = new DataSourceTextField("state", "State");
        stateField.setValueXPath("address/state");

        DataSourceTextField zipField = new DataSourceTextField("zip", "Zip");
        zipField.setValueXPath("address/zip");

        dataSource.setFields(nameField, emailField, orgField, phoneField, streetField,cityField, stateField, zipField);

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

    }

    public Canvas getViewPanel() {

        RPCManager.setPromptStyle(PromptStyle.CURSOR);
        DataSource dataSource = ItemSupplyXmlDS.getInstance();

        ListGridField rowNum = new ListGridField("itemNum", "Item No.");
        rowNum.setWidth(65);
        rowNum.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
View Full Code Here

    public boolean isTopIntro() {
      return true;
    }

    public Canvas getViewPanel() {
    DataSource supplyItemDS = ItemSupplyXmlDS.getInstance();
   
    final DynamicForm form = new DynamicForm();
    form.setWidth(500);
    form.setNumCols(4);
   
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");
        DataSourceDateTimeField startDateField = new DataSourceDateTimeField("startDate");
        DataSourceDateTimeField endDateField = new DataSourceDateTimeField("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() {

        DataSource dataSource = new DataSource() {
            @Override
            protected void transformResponse(DSResponse response, DSRequest request, Object xmlData) {
                String status = XMLTools.selectString(xmlData, "/response/status");
                if(!status.equals("success")) {
                    response.setStatus(RPCResponse.STATUS_VALIDATION_ERROR);
                    Object errors = XMLTools.selectNodes(xmlData, "/response/errors");
                    JavaScriptObject errorsJS = XMLTools.toJS(errors);
                    response.setErrors(errorsJS);
                }
            }
        };
        dataSource.setDataFormat(DSDataFormat.XML);
        dataSource.setDataURL("data/dataIntegration/xml/serverValidationErrors/serverResponse.xml");
        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

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        DataSource ds = EmployeeXmlDS.getInstance();

        final DynamicForm form = new DynamicForm();
        form.setWidth(300);
       
        SelectItem item = new SelectItem();
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.