Package com.smartgwt.client.data

Examples of com.smartgwt.client.data.DSCallback


    protected void deleteSelectedRecords(DSRequest requestProperties) {
        ListGrid listGrid = getListGrid();
        final int selectedRecordCount = listGrid.getSelectedRecords().length;
        final List<String> deletedRecordNames = new ArrayList<String>(selectedRecordCount);
        listGrid.removeSelectedData(new DSCallback() {
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                if (response.getStatus() == DSResponse.STATUS_SUCCESS) {
                    Record[] deletedRecords = response.getData();
                    for (Record deletedRecord : deletedRecords) {
                        String name = deletedRecord.getAttribute(getTitleFieldName());
View Full Code Here


                Message.Severity.Warning, EnumSet.of(Message.Option.Transient));
            CoreGUI.getMessageCenter().notify(message);
            return;
        }

        this.form.saveData(new DSCallback() {
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                if (response.getStatus() == RPCResponse.STATUS_SUCCESS) {
                    Record[] data = response.getData();
                    Record record = data[0];
View Full Code Here

    }

    protected void fetchExistingRecord(final int recordId) {
        Criteria criteria = new Criteria();
        criteria.addCriteria(FIELD_ID, recordId);
        this.form.fetchData(criteria, new DSCallback() {
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                // The below check is a workaround for a SmartGWT bug, where it calls the execute() method on this
                // callback twice, rather than once.
                // TODO: Remove it once the SmartGWT bug has been fixed.
                if (!postFetchHandlerExecutedAlready) {
View Full Code Here

                resourceIds[i++] = resource.getId();
            }
            ResourceDatasource resourceDatasource = new ResourceDatasource();
            Criteria criteria = new Criteria();
            criteria.addCriteria(ResourceDatasource.FILTER_RESOURCE_IDS, resourceIds);
            resourceDatasource.fetchData(criteria, new DSCallback() {
                public void execute(DSResponse response, Object rawData, DSRequest request) {
                    if (response.getStatus() != DSResponse.STATUS_SUCCESS) {
                        throw new RuntimeException(MSG.view_group_operationScheduleDetails_failedToLoadMembers());
                    }
                    Record[] data = response.getData();
View Full Code Here

        // TODO until http://code.google.com/p/smartgwt/issues/detail?id=490 is fixed always go to the server for data
        this.datasource.invalidateCache();
        DSRequest requestProperties = new DSRequest();
        requestProperties.setStartRow(0);
        requestProperties.setEndRow(getMaxAvailableRecords());
        this.datasource.fetchData(criteria, new DSCallback() {
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                try {
                    availableRecords = new ArrayList<Record>();
                    Record[] allRecords = response.getData();
                    int assignedNumber = doPostPopulateAvailableGrid(allRecords);
View Full Code Here

                DSRequest requestProperties = new DSRequest();
                requestProperties.setAttribute(
                    AbstractConfigurationHistoryDataSource.RequestProperty.FETCH_CONFIGURATION, true);

                getDataSource().fetchData(criteria, new DSCallback() {
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        ArrayList<AbstractResourceConfigurationUpdate> updatesWithConfigs = new ArrayList<AbstractResourceConfigurationUpdate>();
                        Record[] records = response.getData();
                        for (Record record : records) {
                            AbstractResourceConfigurationUpdate update = (AbstractResourceConfigurationUpdate) record
View Full Code Here

        }
    }

    private void saveForm(final DynamicForm form, final DynaGroupChildrenView dynaGroupChildrenView,
        final boolean recalc) {
            form.saveData(new DSCallback() {
                @Override
                public void execute(DSResponse response, Object rawData, DSRequest request) {
                    boolean hasDuplicateNameError = false;
                    boolean hasParseExpressionError = false;
                    if (form.isNewRecord()) {
View Full Code Here

                        ResourceTreeDatasource dataSource = new ResourceTreeDatasource(lineage, lockedData, treeGrid);
                        treeGrid.setDataSource(dataSource);

                        addMember(treeGrid);

                        treeGrid.fetchData(treeGrid.getCriteria(), new DSCallback() {

                            public void execute(DSResponse response, Object rawData, DSRequest request) {
                                Log.info("Done fetching data for tree.");

                                CoreGUI.showBusy(false);;
View Full Code Here

        layout.addMember(form);

        IButton button = new IButton("Save New");
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                form.saveData(new DSCallback() {
                        public void execute(DSResponse response, Object rawData, DSRequest request) {
                              form.editNewRecord();
                        }
                    });
                form.reset();
View Full Code Here

       
        ButtonItem saveBtn = new ButtonItem("Save");
        saveBtn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                event.getForm().saveData(new DSCallback() {
                    @Override
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        Record rec = response.getData()[0];
                        JavaScriptObject rawItems = rec.getAttributeAsJavaScriptObject("items");
                        String html = StringUtil.asHTML(new JSONEncoder().encode(rawItems));
                        SC.say("Record saved with items:" + html);
                    }
                });
            }
        });
       
        exampleForm.setItems(orderID, orderDate, items, saveBtn);
       
        Criteria orderCriteria = new Criteria();
        orderCriteria.addCriteria("orderID", 1);
        orderDS.fetchData(orderCriteria, new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {
                DynamicForm exampleForm = (DynamicForm) Canvas.getById("exampleForm");
                exampleForm.editRecord(response.getData()[0]);
            }
View Full Code Here

TOP

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

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.