Quantcast
Viewing all 4756 articles
Browse latest View live

Weird interaction between LGPL and EE showcase Developer Console in IE11

Hi Isomorphic,

I'm analysing a problem I have with current IE11/Win8.1 and current SmartGWT 5.0p.

Therefore I'm browsing the samples in the showcases.
When opening the Developer Console in both tabs (LGPL and EE showcases), sometimes they do not completely reload, even if the URL of the Developer Console changes.

I tested with an empty cache and the online showcases. Just open and close or open and open other Developer Console, until you get a picture like the attached one. This does not happen in FF26 for me until now.

Best regards,
Blama

Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
Developer_Console_Mismatch.png (62.3 KB)

Bug with ComboBoxItem Vertical Scrollbar in Simplicity Skin

Hi Isomorphic,

I noticed a severe bug with ComboBoxItem in IE11 (Win8.1) only in Simplicity Skin. Unfortunately I can't present a quick way to it, as you removed Simplicity from the showcases examples. I can't produce it in current on-line Showcases with IE11 in Enterprise skin nor in my application with GC42/FF26 in Simplicity skin.

I'm using v10.0p_2015-04-10.

Steps I do:
  • Open a ComboBoxItem that scrolles its data vertically (I open it by using the mouse and the arrow next to the text field)
  • Click the scrollbar, the popup closes
  • If you reopen the popup, it is one scrollbar-width shifted to the right and has the same defect
  • The shifting only happens once

This is my ComboBoxItem setup, if this helps:
Code:

public class ComboBoxItemCampaign extends ComboBoxItem {
        final private DataSource campaignDS = DataSource.get(DatasourceEnum.T_CAMPAIGN.getValue());

        public ComboBoxItemCampaign(String name, boolean withOtherLECampaigns, boolean defaultToFirstOption) {
                super(name);
                setOptionDataSource(campaignDS);

                if (withOtherLECampaigns) {
                        setOptionOperationId("fetchOwnAndOtherLECampaigns");
                } else {
                        setOptionOperationId("fetchOwnLECampaigns");
                        setOptionCriteria(new AdvancedCriteria(OperatorId.AND, new Criterion[] {
                                        new Criterion("STARTDATE", OperatorId.LESS_OR_EQUAL, new Date()),
                                        new AdvancedCriteria(OperatorId.OR, new Criterion[] { new Criterion("ENDDATE", OperatorId.GREATER_OR_EQUAL, new Date()),
                                                        new Criterion("ENDDATE", OperatorId.IS_NULL) }) }));
                }
                setValueField(campaignDS.getPrimaryKeyFieldName());
                setFetchMissingValues(true);

                setDisplayField("NAME");
                setSortField("NAME");

                setValidateOnExit(true);
                setDefaultToFirstOption(defaultToFirstOption);
                setTextMatchStyle(TextMatchStyle.SUBSTRING);
                setBrowserSpellCheck(false);
        }
}


Best regards
Blama

Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
ComboBoxItem Scrollbar.png (12.3 KB)
Image may be NSFW.
Clik here to view.
File Type: png
IE11 Version.png (14.6 KB)

Simplicity Skin in online showcases

Hello Isomorphic,

could you re-enable Simplicity Skin in online LGPL/EE showcases (at least one, best both)?

My skin is based on Simplicity and in this bug report, having the simplicity skin in the online showcase would have made it easier to supply a test case.

Best regards
Blama

Reset field's old value: wrong value from ListGrid getEditValues

Hello,

We upgraded our application from 4.0p (NIGHTLY 2014-02-12) to 5.0p (NIGHTLY-2015-04-15) and we have an issue with reset old value on a field.
If you run the example and you edit field "Country" and press tab to navigate to the next field, you have the following behaviour:
if the old value is 'Italy' and the entered value is 'France' after the code in the fieldEditorExit that resets old value to 'Italy' the log 'Edit value is ' shows 'France', and not 'Italy'.
In field's editorExit we want to reset the old value, due to an application use case that interacts with server (to simulate that we use a timer);

Code:

public void onModuleLoad() {
               
                CustomListGrid listGrid = new CustomListGrid();
               
                listGrid.setID("simpleListGrid");
                listGrid.setWidth(500);
                listGrid.setHeight(224);
                listGrid.setAutoFetchData(true);
                listGrid.setData(CountryData.getRecords());
                listGrid.setSelectionType(SelectionStyle.SINGLE);
                listGrid.setEditEvent(ListGridEditEvent.CLICK);
                listGrid.setAutoSaveEdits(false);
                listGrid.setCanEdit(true);
               
                listGrid.setFields(getFields());

                listGrid.draw();
        }
       
        private ListGridField[] getFields() {
               
                ListGridField countryCodeField = new ListGridField("countryCode", "Flag", 40);
                countryCodeField.setAlign(Alignment.CENTER);
                countryCodeField.setType(ListGridFieldType.IMAGE);
                countryCodeField.setImageURLPrefix("flags/16/");
                countryCodeField.setImageURLSuffix(".png");
                countryCodeField.setCanEdit(false);
                countryCodeField.setFrozen(true);

                ListGridField nameField = new ListGridField("countryName", "Country");
                nameField.addEditorExitHandler(new EditorExitHandler() {
                       
                        @Override
                        public void onEditorExit(final EditorExitEvent event) {
                               
                                Timer timer = new Timer() {
                                       
                                        @Override
                                        public void run() {
                                               
                                                String field = "countryName";
                                               
                                                int recordIndex = event.getRowNum();
                                               
                                                ListGrid grid = event.getGrid();
                                                ListGridRecord record = grid.getRecord(recordIndex);
                                                String value = record.getAttributeAsString(field);
                                               
                                                GWT.log("Restore old value is " + value);
                                               
                                                grid.setEditValue(recordIndex, field, value);
                                               
                                                GWT.log("Edit value is " + grid.getEditValues(recordIndex).get(field));
                                               
                                        }
                                };
                                timer.schedule(500);
                               
                        }
                });
               
                ListGridField continentField = new ListGridField("continent", "Continent");
                ListGridField memberG8Field = new ListGridField("member_g8", "Member G8");
                ListGridField populationField = new ListGridField("population", "Population");
                populationField.setType(ListGridFieldType.INTEGER);
               
                ListGridField independenceField = new ListGridField("independence", "Independence");
               
                return new ListGridField[]{countryCodeField, nameField, continentField, memberG8Field, populationField, independenceField};
        }

        private class CustomListGrid extends ListGrid {
               
                /**
                * {@inheritDoc}
                */
                @Override
                public boolean canEditCell(int rowNum, int colNum) {
                       
                        Record editedRecord = getEditedRecord(rowNum);
                        String attributeAsString = editedRecord.getAttributeAsString("country");

                        GWT.log(attributeAsString);
                       
                        return true;
                }
               
        }

For your help we have noticed:
- if you remove timer from fieldEditorExit the log shows the correct value ('Italy');
- override method canEditCell and call to method getEditedRecord inside this method produce the issue;
- override method canEditCell without call the method getEditedRecord inside canEditCell it doesn't produce the issue (also with the timer).

How can I override the canEditCell method calling also the getEditedRecord method and reset value on the fieldEditorExit?

Is it possible to different server.properties for different environments?

I'm looking for a way to use different server.properties for production vs. development/test. Are there some best-practices around this?

Saving UTF-8 data in SGWT

Hello there,

Using SmartClient Version: v10.0p_2015-03-13/PowerEdition Deployment (built 2015-03-13) with Firefox 26
I have a listgrid where i type in UTF-8 character and then when i try to save it to my database the data is saved as ?????????. I have put
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

in my html file. In the developer Console when I look into the RPC tab. I see the DSREquest is being sent in UTF-8 format but in the DSResponse and in my db I get this ??????.
In my database table I have defined the col type as nvarchar which is the requirement for saving utf-8. but the problem is smartgwt is not sending the text in proper format into the db. can somebody help me to get this correct.

In the console I see everything correct

=== 2015-04-22 12:45:25,929 [9-27] INFO PoolManager - [builtinApplication.importExcelDS_add] SmartClient pooling started for 'SQLServer' objects
=== 2015-04-22 12:45:25,929 [9-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.importExcelDS_add] Initializing SQL config for 'SQLServer' from system config - using DriverManager: net.sourceforge.jtds.jdbc.Driver
=== 2015-04-22 12:45:25,929 [9-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.importExcelDS_add] net.sourceforge.jtds.jdbc.Driver lookup successful
=== 2015-04-22 12:45:25,929 [9-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.importExcelDS_add] DriverManager fetching connection for SQLServer via jdbc url jdbc:jtds:sqlserver://localhost:1433;DatabaseName=dbilling;useUnicode=true;characterEncoding=UTF-8;sendStringAsUnicode=true;User=teoit;Password=seop
=== 2015-04-22 12:45:25,929 [9-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.importExcelDS_add] Passing JDBC URL only to getConnection

=== 2015-04-22 12:45:25,999 [9-27] INFO SQLDriver - [builtinApplication.importExcelDS_add] Executing SQL update on 'SQLServer': INSERT INTO sales (available, productMth, productName, productYr) VALUES (NULL, NULL, 'به آسا اماکن ۸ ٪ - ۴ لیتر - محلول ضد عفونی کننده', NULL)

The only thing that is missing is the N which should have been there before the utf-8 string. like so

INSERT INTO sales (available, productMth, productName, productYr) VALUES (NULL, NULL, N'به آسا اماکن ۸ ٪ - ۴ لیتر - محلول ضد عفونی کننده', NULL)

cheers
Zolf

uploadItem.addChangedHandler does not fire twice with same file name

Hi,

I have a problem with addChangedHandler(...) method on UploadItem.

Code:

uploadItem.addChangedHandler(new ChangedHandler() {

            @Override
            public void onChanged(ChangedEvent event) {
                // doSomething
                doSomething();
            }
        });

My 1st scenario :

- Click on UploadItem then choose file "image.jpg"
- The onChanged(...) method is executed
- Click again on UploadItem then choose same file "image.jpg"
- The onChanged(...) method is NOT executed

My 2nd scenario :

In two different directories I have two images with same file name but different binary data

- filePath1/image.jpg -> the picture of a dog
- filePath2/image.jpg -> the picture of a cat

- Click on UploadItem then choose file "image.jpg" (dog image)
- The onChanged(...) method is executed
- Click again on UploadItem then choose "image.jpg" (cat image)
- The onChanged(...) method is NOT executed

I did the same with multiple files chosen in the file chooser, results are the same if file(s) name(s) are the same no matter on binary content.

It seems FormItem's detect value has been changed only looking on file name which is problematic for me.
I would like it systematic even if same file (same binary content) is beeing chosen several times.

Isomorphic, can you confirm me please that this is a bug ?

GWT Version : 2.6.1
SmartGWT Version : 5.0-p20141210
Firefox version : 24

I did the test with Firefox 36 also and the results are the same.

Thanks by advance.

Regarding DynamicForm select items with multiple:true

I have created a DynamicForm having an item with type select and attribute multiple true.
Its listing all the values in checkbox format, Can we programmatically select the checkbox items?

Below is the code snippet:
this.filterForm = isc.DynamicForm.create({
ID: this.ID + "_filterForm",
numCols: 8,
autoFocus: false,
parentInstance:this,
items:[
{ type: "select",
name: "filter_serviceType",
multiple:true,
defaultValue:"Select one",
valueMap:{source1:'source1',source2:'source2',source3:'source3',source4:'source4'},
title:"Throughput",
width:150,
},
],
itemChange : function(item, newValue, oldValue){


}
});

I want all the items to be selected when its rendered, could you please let us know how to do that?

When ListGrid 'Group by' option is disabled, give prompt explaining why

When a ListGrid exceeds groupByMaxRecords, the various 'Group by x' options in the ContextMenus of the Header items are disabled.

The end user has no way of knowing for what reason they are disabled.

One solution would be to offer a prompt when the user hovers over the disabled item. Something like, "You cannot group by with more than x records".

ListGridField's have prompt as property. Perhaps if they had disabledPrompt, you could use that.

Form with deletion and reordering

Hello, I am curious as to how one would create something like what I
have in this screenshot mockup:

https://www.evernote.com/shard/s309/sh/64b918bd-9429-41dd-85a8-00fc3d502721/498cb0bd5e18b6622ef8767f1c4d194f/deep/0/Creately---Draw,-Share,-Validate-and-Export-diagram.png

1. The goal is to enter a single FormRow at a time. Each FormRow gets
added to a FormRowListForm.
2. This FormRowListForm can be reordered by dragging with a mouse.
3. Rows can be removed by clicking on the "Remove Row"
button.
4. The FormRowListForm can be commited to database by
clicking "Commit Form Rows to Database"

Error in javascript console: Maximum call stack size exceeded

Hello,

I upgraded our application from 4.0p (NIGHTLY 2014-02-12) to 5.0p (NIGHTLY-2015-04-15) and during the test of the application I have the following error in console:
Maximum call stack size exceeded.

Running the code below you can repeat the issue:

Code:

        public void onModuleLoad() {
               
                DynamicForm pageLayout = new DynamicForm();
                pageLayout.setNumCols(1);
                pageLayout.setFields(getCanvasItem());
                pageLayout.setColWidths("*");
                pageLayout.setShowEdges(false);

                Window window = new Window();

                // set window properties
                window.setTitle("A");
                window.setWidth(400);
                window.setHeight(200);
                window.setAutoCenter(true);
                window.setIsModal(true);
                window.setShowModalMask(false);
                window.setShowMaximizeButton(false);
                window.setShowMinimizeButton(false);
                window.setShowCloseButton(false);
               
                // add form panel to the window
                window.addItem(pageLayout);
               
                window.show();
               
        }
       
        private CanvasItem getCanvasItem() {
               
                Button button = new Button("prova");

                VLayout layout = new VLayout();
                layout.addMember(getForm());
                layout.addMember(button);
               
                CanvasItem item = new CanvasItem();
                item.setShowTitle(false);
                item.setCanvas(layout);
                item.setName("pippo");
               
                int width = 100;

                Integer widthObject = 200;
               
                if (widthObject != null) {
                       
                        width = widthObject.intValue();
                        item.setWidth(width);
                }
               
                item.setRowSpan(1);
                item.setColSpan(1);
                item.setStartRow(true);
                item.setEndRow(true);
               
                return item;
        }
       
        private DynamicForm getForm() {
               
                DynamicForm form = new DynamicForm();
                form.setWidth(200);
                form.setHeight(100);
               
                TextItem item = new TextItem();
                item.setTitle("item");
                item.setTabIndex(0);
               
                form.setFields(item);
               
                return form;
        }

To repeat the error you must digit some character in the field "item" and then press tab key.

Please note that the layout reproduce a complex layout that I have in my application.

Custom operations in HibernateDataSource

I wish to implement business logic during data source operations. My data sources are configured with serverType="hibernate". In the data source XML configurations, I know I can specify a class name for the "serverConstructor" attribute, and within the class I can implement the various methods (executeAdd, executeFetch, executeRemove, etc). Within those methods, I can manipulate the data values passed as Maps via the DSRequest.

But what I'd prefer to do is invoke bean methods on the underlying Hibernate-mapped classes, and also obtain a Hibernate session for conducting any further queries necessary to support the custom business logic. So, basically, I want to intercept the operation, run some business logic that operates upon Hibernate-mapped classes, and then let Hibernate complete its persistence operation.

What is the "best practices" way of doing this within the SmartGWT framework? I am running SmartClient Version: v8.3p_2013-08-06/Pro Deployment (built 2013-08-06)

I've looked into using Hibernate interceptors but I am unsure how to configure them to work with SmartGWT, since I am relying on SmartGWT to detect the hibernate.cfg.xml configuration in the classpath to initialize the session factory.

Thanks for any suggestions,
Dave

Multiple issues in paged Treegrid

Hi,

Working with the paged tree-databinding i have discovered three more issues.
Because they are different to the last few bugs(http://forums.smartclient.com/showthread.php?t=32566,http://forums.smartclient.com/showthread.php?t=32651) i post them into a this thread insted of "reopening" the old.

1. If you open the example below you can see, that the datasource returns open folders. This is important for this example.
At the beginning it's clear that the treegrid has to load the children of the root-node. After that the Treegrid has to load the childs of the of the "root-x" nodes. At this point i'm wondering, why the end-parameter is counting down, even if i have set the dataFetchSize to 50.
Sure i can ignore the given end-parameter at the server-side and could return all children instead, but i think this should be set right at the request.
Code:

treegrid.php?operationType=fetch&parentId=root-1&delay=50&sortBy=null&start=0&end=14
treegrid.php?operationType=fetch&parentId=root-2&delay=50&sortBy=null&start=0&end=13
treegrid.php?operationType=fetch&parentId=root-3&delay=50&sortBy=null&start=0&end=12
treegrid.php?operationType=fetch&parentId=root-4&delay=50&sortBy=null&start=0&end=11
treegrid.php?operationType=fetch&parentId=root-5&delay=50&sortBy=null&start=0&end=10

2. Maybe you have already noticed the newly-added delay parameter to my extended exampe of the other posts ;-). The paged databinding of the tree makes imho only sense with large trees. Therefore it is possible that the latency of the server are not the same as localhost. So i have set a "delay" parameter to simulate server-workload. In the example below i have set it to 50 ms.
The result of a slight delay on the server is that after the call of all "root-x" nodes there comes a second bunch of load to the backend.
Code:

treegrid.php?operationType=fetch&parentId=root-1&delay=50&sortBy=null&start=0&end=14
treegrid.php?operationType=fetch&parentId=root-2&delay=50&sortBy=null&start=0&end=13
treegrid.php?operationType=fetch&parentId=root-3&delay=50&sortBy=null&start=0&end=12
treegrid.php?operationType=fetch&parentId=root-4&delay=50&sortBy=null&start=0&end=11
treegrid.php?operationType=fetch&parentId=root-5&delay=50&sortBy=null&start=0&end=10
...
treegrid.php?operationType=fetch&parentId=root-13&delay=50&sortBy=null&start=0&end=2
treegrid.php?operationType=fetch&parentId=root-14&delay=50&sortBy=null&start=0&end=1

treegrid.php?operationType=fetch&parentId=root-1&delay=50&sortBy=null&start=0&end=27
treegrid.php?operationType=fetch&parentId=root-3&delay=50&sortBy=null&start=0&end=13
treegrid.php?operationType=fetch&parentId=root-4&delay=50&sortBy=null&start=0&end=12
treegrid.php?operationType=fetch&parentId=root-5&delay=50&sortBy=null&start=0&end=11
treegrid.php?operationType=fetch&parentId=root-6&delay=50&sortBy=null&start=9&end=59

I wasn't able to reproduce this properly, but at testing this out it was reproducable in 1 of 5 times. Often there is no additional request, sometimes only 1 additional request and sometimes there are - like in the code-block - 5 additional requests. edit: It is also reproducable without the delay-parameter.

3. In our TreeGrid we have a few cells which needs to be in two lines. So we have set "fixedRecordHeights: false". It's clear to me that working with this attribute and DataBindings can result in struggeling while jumping in the Grid (for example scrollToRow in ListGrids). In the ListGrid there is no problem if you have set "fixedRecordHeights: false", but only work with records which have only 1 line in each field.
In the TreeGrid there seems to be a scrolling issue, if you set the "fixedRecordHeights: false" and begin to scroll with the mouse-wheel. If you start scrolling, the nodes at the bottom will get rendered, but at the top you can see the nodes are jumping up again. The same thing happens if you are at the bottom and scroll upwards.
Image may be NSFW.
Clik here to view.
.
Note to this gif: I was only scrolling down with the mouse-wheel. The jumping back up again is the issue described here.

All three issues are reproducable with the latest nightly from SmartClient_v100p_2015-04-22_Pro.

Issue 1 and 3 i could reproduce in all current versions from Chrome, Firefox and IE.
Issue 2 i could reproduce in Chrome and IE, maybe Firefox, but it was too bring to click F5 dozen of times.

This is the code, with which i could reproduce all 3 issues:
Code:

isc.VLayout.create({
        "ID" : "rootLayout_5",
        "width" : "100%",
        "height" : "100%",
        "autoDraw" : true,
        "hideUsingDisplayNone" : false,
        "leaveScrollbarGap" : false,
        "members" :
        [
                isc.TreeGrid.create({
                        "ID" : "theTreeGrid",
                        "width" : "100%",
                        "height" : "100%",
                        "selectionType" : "multiple",
                        "canEdit" : false,
                        "showFilterEditor" : false,
                        dataSource : isc.DataSource.create({
                                "fields" :
                                [{
                                                "name" : "treeGridGeneratedIndex",
                                                "primaryKey" : true,
                                                "hidden" : true,
                                                "canView" : false
                                        }, {
                                                "name" : "nameField",
                                                "title" : "Reason",
                                                "type" : "text"
                                        }, {
                                                "name" : "parentId",
                                                "rootValue" : "root",
                                                "foreignKey" : "treeGridGeneratedIndex",
                                                "hidden" : true
                                        }
                                ],
                                "dataFormat" : "json",
                                "dataURL" : "http://devset.de/treegrid.php",
                                "transformRequest" : requestTransformer,
                                "transformResponse" : responseTransformer,
                                "recordXPath" : "\/resultData",
                                useHttpProxy : false
                        }),
                        dataProperties : {
                                openProperty : "isOpen",
                                childrenProperty : "children",
                                canReturnOpenFolders: true
                        },
                        "fixedRecordHeights" : false,
                        "autoFetchData" : true,
                        "dataPageSize" : 50,
                        "dataFetchMode" : "paged",
                        "selectionProperty" : "isSelected",
                        "fields" :
                        [{
                                        "name" : "nameField",
                                        "title" : "Reason",
                                        "type" : "text",
                                        "canEdit" : true,
                                        "canSort" : true
                                }, {
                                        "name" : "lastField",
                                        "title" : "Name",
                                        "type" : "text",
                                        "canEdit" : true,
                                        "canSort" : true
                                }, {
                                        "name" : "randomField",
                                        "title" : "random",
                                        "type" : "text",
                                        "canEdit" : true,
                                        "canSort" : true
                                }
                        ],
                        "selectionProperty" : "isSelected",
                        "members" :
                        []
                })
        ]
});
function requestTransformer(dataSourceRequest) {
        var operationType = {
                operationType : dataSourceRequest.operationType
        };
        if (dataSourceRequest.operationType == "fetch") {
                var params = {
                        delay: 50,
                        sortBy : dataSourceRequest.sortBy,
                        start : dataSourceRequest.startRow,
                        end : dataSourceRequest.endRow
                };
        }
        return isc.addProperties({}, operationType, dataSourceRequest.data, params);
}
function responseTransformer(dataSourceResponse, dataSourceRequest, jsonData) {
        if (dataSourceRequest.operationType == "fetch") {
                dataSourceResponse.totalRows = jsonData.totalRows;
                dataSourceResponse.endRow = jsonData.endRow;
                dataSourceResponse.startRow = jsonData.startRow;
        };
}

Best regards

grid with setSummaryRowDataSource() fetches summary row multiple times on viewState

1. SmartClient Version: v10.0p_2015-04-22/LGPL Development Only (built 2015-04-22)
2. Firefox 24.8.0 on gentoo linux

Hi,
This is striped down test case with basic ListGrid displaying summary row, but summary record is requested from DataSource via lg.setSummaryRowDataSource(ds);
Code:

package pl.com.tech4.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.DOM;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.RestDataSource;
import com.smartgwt.client.data.fields.DataSourceFloatField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.layout.VLayout;

public class MainEntryPoint implements EntryPoint {
 
    public void onModuleLoad() {

        DOM.getElementById("loadingPicture").removeFromParent();
        layout();
        SC.showConsole();
    }
 
    private void layout() {
        RestDataSource ds = new RestDataSource();
        ds.setDataURL("UnitDir.xml");
        DataSourceField fieldId = new DataSourceField();
        fieldId.setName("id");
        fieldId.setPrimaryKey(true);
        fieldId.setHidden(true);
        DataSourceTextField fieldCode = new DataSourceTextField();
        fieldCode.setName("code");
        DataSourceFloatField fieldValue = new DataSourceFloatField();
        fieldValue.setName("value");
        ds.setFields(fieldId, fieldCode, fieldValue);
     
        final ListGrid lg = new ListGrid();
        lg.setDataSource(ds);
        lg.setAutoFetchData(true);
        lg.setShowGridSummary(true);
        lg.setSummaryRowDataSource(ds);
     
        IButton button = new IButton("test");
        button.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                lg.setViewState(lg.getViewState());
            }
        });

        VLayout layout = new VLayout();
        layout.addMember(lg);
        layout.addMember(button);
     
        layout.draw();
     
    }
 
}

UnitDir.xml:
Code:

<response>
    <status>STATUS_SUCCESS</status>
    <startRow>0</startRow>
    <endRow>1</endRow>
    <totalRows>1</totalRows>
    <data>
        <UnitDir>
            <id>1</id>
            <code>kg</code>
            <value>5</value>
        </UnitDir>
    </data>
</response>

Running this example shows two requests/responses on the RPC tab: one for fetching grid's data and the second one fetching summary row. So far so good.
Now, pressing test button, which only resets viewState of the grid:
lg.setViewState(lg.getViewState());
shows identical 3 new requests/responses on RPC tab, each fetching summary record again and again.

Could it be corrected, as it stresses server in a real application (aggregation is sql costly).
Thanks,
MichalG

ListGrid Select & Filtering

Hi, I am using a ListGrid and combine filter and Checkbox select options.
Code:

countryGrid.setShowFilterEditor(true);

countryGrid.setSelectionType(SelectionStyle.SIMPLE);
countryGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);

I select all rows and I filter the data afterwards.

When I remove the filter all the selected rows that were not filtered are now unchecked. Is this the expected behaviour? Is there any option for the non filtered rows to remain selected?

Thanks

P.S Screenshots demonstrating the issue attached.

SmartGwt Version:5.0-p20150422 Browser: Chrome:42.0.2311.90 m

Attached Images
Image may be NSFW.
Clik here to view.
File Type: png
2015-04-23 12_22_40-SmartGWT Playground Project.png (7.6 KB)
Image may be NSFW.
Clik here to view.
File Type: png
2015-04-23 12_23_15-SmartGWT Playground Project1.png (4.2 KB)
Image may be NSFW.
Clik here to view.
File Type: png
2015-04-23 12_23_33-SmartGWT Playground Project3.png (7.1 KB)

Override getGroupSummaryData doesn't work anymore

Did you ever try to override the getGroupSummaryData function in SC 10.0? I had no problems in SC 9.0 but now I get a RangeError:

Code:

WARN:Log:RangeError: Maximum call stack size exceeded
My Code Snippet:
Code:

isc.defineClass("MyListGrid", "ListGrid").addProperties({
  getGroupSummaryData: function(records, groupNode)
  {
    var rVal = this.Super("getGroupSummaryData", arguments);

    // POINT1: doing some custom stuff with rVal
    // ...
  } 
});

POINT1 is never reached in consequence of a infinite loop

TextItem cursor position in IE8/9 when launched from a iFrame

Dear Isomorphic Support:

I have a TextItem in my form. My SmartGwt application is in iframe of other SmartGwt application.
In IE8 and IE9 there is problem with cursor position in TextItem: cursor periodically moves to the start of TextItem during typing.

When I turn on IE compatibility mode, the problem goes away but it leads to other visual bugs.
If I render my app directly outside of an iFrame, the problem goes away also.

I found similar topic: http://forums.smartclient.com/showthread.php?t=24409 but it didn't help.

Details:
Product: SmartGWT 4.0p LGPL
Browser: IE 8, IE 9

DrawImage resize by mouse - BUG or wrong expectations?

Hello!

For
- smartGWT 5.1p - v10.0p_2014-10-07/LGPL Development Only (built 2014-10-07)
- FF 31.5.0 (didn't test on other browsers)

Problem
When I'm resizing an Image by mouse drag, the new dimensions of the image are wrong when releasing the mouse button.

Description
To show what happens I created a class which adds an Image with two handlers that I need in my real code (DragResizeStop and Resized - in both these I will need to run some logic in my actual code). After DragResizeStop fires the Resized is fired and new values (different from what I would expect) for Width/Height are automatically applied to the object. To force the correct dimensions to be applied I set the Width/Height in the DragResizeStop with the values I take from the "event" object but they are overwritten automatically when the Resized triggers. The visual appearance of the Image is not modified but it's dimensions in pixels are wrong.

To exemplify I created the class below:
- Local image
- both handlers (DragResizeStop and Resized)
- added some logs
- in DragResizeStop I set the new Width and new Height from the "event" object to the Image and I print them in the logs
- when entering the Resized I just print the values from the Image object and they are different from the above ones.

What I would expect is that the Image's width/height are updated with the correct values when I release the mouse button - event.getNewWidth() and event.getNewHeight().
It seems that when the Resized is fired, some old (intermediate) values for W/H are applied and not the ones corresponding to the position where the mouse button was released.

Any thoughts? Have I misunderstand they way this works?

Thanks in advance!

P.S: same goes for DrawRect (I haven't tested for other draw items)


Running the code below, after a resize by mouse this is what I see in the logs:

Code:

11:39:13.332:MUP2:INFO:Log:+++++DragResizeStop (image): WxH - 346x203
11:39:13.332:MUP2:INFO:Log:+++++DragResizeStop (event): WxH - 346x203
11:39:13.338:MUP2:INFO:Log:*****Resized (image): WxH - 442x234

Code:

public class TestResize {
       
        public void drawDesign() {

                Layout mainLayout = new Layout();
                mainLayout.setBorder("1px solid black");
               
                DrawPane shapesPane = new DrawPane();
                shapesPane.setCanDrag(true);
                shapesPane.setTop(0);
                shapesPane.setLeft(0);
                shapesPane.setWidth(1200);
                shapesPane.setHeight(800);
                shapesPane.setOverflow(Overflow.HIDDEN);

                final DrawImage image = new DrawImage();
                image.setSrc("cow.jpg");
                image.setTop(50);
                image.setLeft(50);
                image.setWidth(200);
                image.setHeight(200);
                image.showAllKnobs();
                image.setDrawPane(shapesPane);
                image.setCanDrag(true);
                image.setShowResizeOutline(true);
               
                image.addDragResizeStopHandler(new DragResizeStopHandler() {
                        @Override
                        public void onDragResizeStop(DragResizeStopEvent event) {
                                image.setWidth(event.getNewWidth());
                                image.setHeight(event.getNewHeight());
                                // here the correct values are applied on the Image
                                SC.logInfo("+++++DragResizeStop (image): WxH - " + image.getWidth() + "x" + image.getHeight());
                                SC.logInfo("+++++DragResizeStop (event): WxH - " + event.getNewWidth() + "x" + event.getNewHeight());
                        }
                });
               
                image.addResizedHandler(new ResizedHandler() {
                        @Override
                        public void onResized(ResizedEvent event) {
                                // here some other values are present (old or intermediate ones)
                                SC.logInfo("*****Resized (image): WxH - " + image.getWidth() + "x" + image.getHeight());
                        }
                });
               
                image.draw();
       
                shapesPane.draw();

                mainLayout.addMember(shapesPane);
        }
}

Enhancement: Declarative COUNT (DISTINCT x) in OperationBinding's summaryFunctions

Hello Isomorphic,

I just read the ServerSummaries docs because I wanted to apply a "DISTINCT" to a field I am counting.

I noticed this part:
Quote:

Fields with customSelectExpression
Fields with customSelectExpression can be used with server summaries as both groupBy fields or fields with summaryFunction. In case of summaryFunction requested on field with customSelectExpression we will wrap SQL function around the expression, which may or may not be correct.
which solves the problem for me with customSelectExpression="DISTINCT x" (thanks again for the framework, impressive!).

But this only works as I'm never using this DataSource in a non-aggregating manner.
Therefore, an enhancement for the SummaryFunctionType enum would be the following values: COUNTDISTINCT (and SUMDISTINCT, AVGDISTINCT), which would allow a normal use of the DSField as well.

Best regards
Blama


PS: Regarding the SummaryFunctionType-docs: In the "Enum Constant Summary"-table, for some values details are given, for some not. Below in "Enum Constant Detail" everything becomes clear (e.g. MULTIPLIER handling in server).

Cursor keys not working in spinner control

SmartClient Version: v10.0p_2015-01-20/LGPL Development Only (built 2015-01-20)

The bug has been seen in the following browsers:
1. Internet Explorer 11
2. Chrome (Latest)

We don't believe this is browser specific.

Moving the cursor of a SpinnerItem with the Left, Right, Home and End keys is broken if the SpinnerItem is an item of a new Window

In the sample I've provided, the main spinner works fine. The spinner that is launched with a new window is broken.

1. Click the Spinner Item to move focus to it
2. Press the Left, Right, Home and End keys and note that the cursor moves accordingly
3. Now click the button titled 'Launch Window...'. A new Window will appear that contains another Spinner Item
4. Click the Spinner Item in the new Window to move focus to it
5. Press the Left, Right, Home and End keys

Expected: The cursor should move accordingly with the key presses
Actual: No movement occurs when the keys are pressed

The sample code is attached.

Attached Files
Image may be NSFW.
Clik here to view.
File Type: java
WindowSpinnerCursorKeys.java (1.4 KB)
Viewing all 4756 articles
Browse latest View live