nijogeorgep / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

"Select All" checkbox not unchecking when data is unselected with clientOnly DataSource #667

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Create a client-side DataSource and populate it with 1 row
2. Wet ListGrid Selection Appearance to CHECKBOX.
3. Draw the listGrid

What is the expected output?
The checkbox in the header of the listGrid must be enabled and allow the 
selection of all rows

What do you see instead?
The checkbox in the header of the listGrid is disabled and its tooltip says: 
"Can't select many records at once.please try work with smaller batches"

What version of the product are you using? On what operating system?
SmartGWT 3.0
Windows 7

What browser(s) does this happen in?
It occurs on all browsers

Original issue reported on code.google.com by sta191...@gmail.com on 16 Apr 2012 at 3:09

GoogleCodeExporter commented 8 years ago
Please do not post issues without a standalone test case.  Marking invalid 
until one is provided.

Original comment by smartgwt...@gmail.com on 16 Apr 2012 at 4:07

GoogleCodeExporter commented 8 years ago
Here is the smallest test case:

public void onModuleLoad() {
    DataSourceTextField continentField = new DataSourceTextField("continent");
    continentField.setPrimaryKey(true);

    DataSource dataSource = new DataSource();
    dataSource.setClientOnly(true);
    dataSource.setFields(continentField);
    for (CountryRecord record : new CountryData().getNewRecords()) {
        dataSource.addData(record);
    }

    ListGrid myGrid = new ListGrid();
    myGrid.setWidth(200);
    myGrid.setHeight(100);
    myGrid.setDataSource(dataSource);
    myGrid.fetchData();
    myGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    myGrid.setSelectionType(SelectionStyle.SIMPLE);
    myGrid.draw();
}

class CountryData {

    public CountryRecord[] getNewRecords() {
        return new CountryRecord[] { 
                new CountryRecord("North America"), 
                new CountryRecord("Asia") };
    }
}

class CountryRecord extends ListGridRecord {
    public CountryRecord(String continent) {
        setContinent(continent);
    }

    public void setContinent(String continent) {
        setAttribute("continent", continent);
    }

    public String getContinent() {
        return getAttributeAsString("continent");
    }
}

Original comment by sta191...@gmail.com on 17 Apr 2012 at 8:09

GoogleCodeExporter commented 8 years ago
Usage error: don't use addData() to populate a clientOnly DataSource, use 
setCacheData().

Still invalid.

Original comment by smartgwt...@gmail.com on 17 Apr 2012 at 6:17

GoogleCodeExporter commented 8 years ago
There is still 1 error. When you deselect at least one of the rows, the header 
remains selected. Whereas if you select all rows, the header becomes selected. 
Is this normal?

Original comment by sta191...@gmail.com on 18 Apr 2012 at 8:03

GoogleCodeExporter commented 8 years ago
We're not reproducing this and there are autotests showing this working fine.  
We suspect whatever code you're testing with is not what you've posted here.

Original comment by smartgwt...@gmail.com on 18 Apr 2012 at 5:31

GoogleCodeExporter commented 8 years ago
Here is the code I used:

public void onModuleLoad() {
    DataSourceTextField continentField = new DataSourceTextField("continent");
    continentField.setPrimaryKey(true);

    DataSource dataSource = new DataSource();
    dataSource.setClientOnly(true);
    dataSource.setFields(continentField);

    //Setting the cached Data
    //-----------------------------------------------------------
    dataSource.setCacheData(new CountryData().getNewRecords());
    //----------------------------------------------------------

    ListGrid myGrid = new ListGrid();
    myGrid.setWidth(200);
    myGrid.setHeight(100);
    myGrid.setDataSource(dataSource);
    myGrid.fetchData();
    myGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    myGrid.setSelectionType(SelectionStyle.SIMPLE);
    myGrid.draw();
}

class CountryData {

    public CountryRecord[] getNewRecords() {
        return new CountryRecord[] { 
                new CountryRecord("North America"), 
                new CountryRecord("Asia") };
    }
}

class CountryRecord extends ListGridRecord {
    public CountryRecord(String continent) {
        setContinent(continent);
    }

    public void setContinent(String continent) {
        setAttribute("continent", continent);
    }

    public String getContinent() {
        return getAttributeAsString("continent");
    }
}

Original comment by sta191...@gmail.com on 19 Apr 2012 at 10:00

GoogleCodeExporter commented 8 years ago

Original comment by smartgwt...@gmail.com on 19 Apr 2012 at 9:43

GoogleCodeExporter commented 8 years ago

Original comment by smartgwt...@gmail.com on 19 Apr 2012 at 9:43

GoogleCodeExporter commented 8 years ago
Do you have any deadline for the fix?

Original comment by sta191...@gmail.com on 1 May 2012 at 2:23

GoogleCodeExporter commented 8 years ago
This has been fixed in the latests code stream (SC 8.3d / SGWT 3.1d)

Original comment by smartgwt...@gmail.com on 8 May 2012 at 10:52

GoogleCodeExporter commented 8 years ago
Actually a duplicate of an issue reported on the SmartClient forums:

http://forums.smartclient.com/showthread.php?t=21976

Original comment by smartgwt...@gmail.com on 8 May 2012 at 10:55

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Using the latest version of SmartGWT 3.0 downloaded from the below link, this 
issue is still present.

http://www.smartclient.com/product/download-bounce.jsp?product=smartgwt&license=
lgpl&version=3 .0p&nightly=true

Original comment by sta191...@gmail.com on 9 May 2012 at 2:06