Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridField behavior of boolean fields changed after SmartGWT update

    We've updated from SmartGWT 6.0-p20170620 to 6.1-p20180407 as recommended in an other post. Unfortunately, the ListGridField behavior of the boolean fields have changed.

    In the previous version we were able to edit the boolean fields without executing a double-click to activate the edit mode. The Boolean fields could be toggled directly. This is no longer possible.

    All attempts to circumvent the behavior, unfortunately failed. It seems like the setCanToggle () method is not working anymore. Pleas can you help us?

    ListGrid listGrid = new ListGrid();
    listGrid.setWidth100();
    listGrid.setHeight100();
    listGrid.setDataSource("dic_languages");
    listGrid.setAutoFetchData(true);
    listGrid.setCanEdit(true);
    //listGrid.setEditEvent(ListGridEditEvent.CLICK); //this improves the usability in our case, but it is not the old behaviour of the old version
    //listGrid.setEditByCell(true); //this improves the usability in our case, but it is not the old behaviour of the old version

    ListGridField locale = new ListGridField("LOCALE", "locale");
    locale.setType(ListGridFieldType.TEXT);
    ListGridField enabled = new ListGridField("ENABLED", "enabled");
    enabled.setType(ListGridFieldType.BOOLEAN);
    enabled.setCanToggle(true);
    enabled.setCanEdit(true);

    listGrid.setFields(locale, enabled);

    VLayout layout = (VLayout) BaseWidget.getById("TEST_VLayout0");
    layout.addMember(listGrid);
    Last edited by EISENMANN; 26 Apr 2018, 10:20.

    #2
    We're having difficulty reproducing this problem in the latest 6.1p build (Dated 4-25).
    Here's a complete functional standalone test case based off your snippet which is working for us:
    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.data.DataSourceField;
    import com.smartgwt.client.types.FieldType;
    import com.smartgwt.client.types.ListGridFieldType;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.BaseWidget;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class CanToggleTest implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
    
            ListGrid listGrid = new ListGrid();
            listGrid.setWidth100();
            listGrid.setHeight100();
    
    //        listGrid.setDataSource("dic_languages");
    
            DataSource testDS = new DataSource();
            testDS.setClientOnly(true);
            DataSourceField f0 = new DataSourceField("pk", FieldType.SEQUENCE);
            f0.setPrimaryKey(true);
            DataSourceField f1 = new DataSourceField("LOCALE", FieldType.TEXT);        
            DataSourceField f2 = new DataSourceField("ENABLED", FieldType.BOOLEAN);
    
            testDS.setFields(f0, f1,f2);
    
            ListGridRecord testRecord = new ListGridRecord();
            testRecord.setAttribute("pk",0);
            testRecord.setAttribute("LOCALE","AAAAA");
            testRecord.setAttribute("ENABLED",  true);
    
            ListGridRecord testRecord2 = new ListGridRecord();
            testRecord2.setAttribute("pk",1);
            testRecord2.setAttribute("LOCALE","BBBB");
            testRecord2.setAttribute("ENABLED",  false);
    
            testDS.setCacheData(testRecord,testRecord2);
    
            listGrid.setDataSource(testDS);
    
    
            listGrid.setAutoFetchData(true);
            listGrid.setCanEdit(true);
            //listGrid.setEditEvent(ListGridEditEvent.CLICK); //this improves the usability in our case, but it is not the old behaviour of the old version
            //listGrid.setEditByCell(true); //this improves the usability in our case, but it is not the old behaviour of the old version
    
            ListGridField locale = new ListGridField("LOCALE", "locale");
            locale.setType(ListGridFieldType.TEXT);
            ListGridField enabled = new ListGridField("ENABLED", "enabled");
            enabled.setType(ListGridFieldType.BOOLEAN);
            enabled.setCanToggle(true);
            enabled.setCanEdit(true);
    
            listGrid.setFields(locale, enabled);
    
            listGrid.draw();
    
    //        VLayout layout = (VLayout) BaseWidget.getById("TEST_VLayout0");
    //        layout.addMember(listGrid);         
    
        }
    
    }
    The most likely explanation for your problem is that some other issue is interfering with the toggle - most likely a failure to save the change to the dataSource or similar.
    We'd recommend you take the following steps:
    - re test with the latest 6.1p build (just to ensure this isn't a framework problem which has been resolved since 04-07)
    - if the problem persists, check the developer console for any reported errors which may shed light on the problem

    If you can't see a way forward, we'd recommend you share any developer console logs with us and consider putting together a complete, runnable test case which we can run without modification to reproduce the problem.

    Comment


      #3
      Thanks for the fast reply. I tried exactly the same code snippet which you have posted. But the issue still occurs. We use the SmartGWT PowerEdition v11.1p_2018-04-25/PowerEdition Deployment (built 2018-04-25).

      I tested it on different Browser (latest Chrome and latest Firefox). I haven't any exceptions, errors or warnings in the SmartClient developer console and also not in the browser console.

      When I go back to SmartGWT 6.1-20170723 it works fine. Please can you test it again with the PowerEdition that I mentioned above.

      Comment


        #4
        If Boolean fields were just broken in the way you describe, we'd be getting a lot of reports. Can you try this code in a clean project, no third party libraries included, no CSS other than what the skins provide, no browser extensions? That's how we're testing, and we suspect you'll get the same result if you test this way.

        Comment

        Working...
        X